mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor(output): share the JSON, created-resource and batch tails
Mutations end with a.jsonResult or a.created instead of hand-rolled --json branches, the two identical jsonResult/writeMutationJSON helpers become one, and writeBatchJSON checks --json itself so batch commands share one tail. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
32 files changed
+87
-217
No files matched your search
@@ -431,10 +431,7 @@ $ tea webhook create https://hooks.slack.com/services/T0/B0/X --org acme --type
|
||||
return err
|
||||
}
|
||||
a.done(cmd, "Created %s in %s for %s", webhookLabel(hook), webhookScopeName(service.Scope), collapsedEvents(hook.Events))
|
||||
if err := a.printURL(cmd, webhookSettingsURL(target, service.Scope, hook.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
return a.jsonResult(cmd, hook)
|
||||
return a.created(cmd, hook, webhookSettingsURL(target, service.Scope, hook.ID))
|
||||
}
|
||||
return command
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user