mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11: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
@@ -352,7 +352,7 @@ func (a *application) assetEditCommand() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
a.done(cmd, "Renamed asset %s to %s in release %s", asset.Name, item.Name, release.Tag)
|
||||
return a.writeMutationJSON(cmd, item)
|
||||
return a.jsonResult(cmd, item)
|
||||
},
|
||||
}
|
||||
command.Flags().StringVar(&name, "name", "", "New asset name")
|
||||
|
||||
Reference in new issue
Block a user