MCPcopy Create free account
hub / github.com/compozy/agh / newUpdateCommand

Function newUpdateCommand

internal/cli/update.go:51–75  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

49}
50
51func newUpdateCommand(deps commandDeps) *cobra.Command {
52 var checkOnly bool
53
54 cmd := &cobra.Command{
55 Use: updateUpdateKey,
56 Short: "Check for and apply the latest stable AGH release",
57 Long: strings.TrimSpace(`
58Check GitHub Releases for the latest stable AGH build and apply it when this install supports
59self-update. Managed installs return the exact package-manager upgrade path instead of mutating
60files directly.
61 `),
62 Example: strings.TrimSpace(`
63 agh update
64 agh update --check
65 agh update -o json
66 `),
67 Args: cobra.NoArgs,
68 RunE: func(cmd *cobra.Command, _ []string) error {
69 return runUpdateCommand(cmd, deps, checkOnly)
70 },
71 }
72
73 cmd.Flags().BoolVar(&checkOnly, "check", false, "Check for a newer stable release without changing files")
74 return cmd
75}
76
77func runUpdateCommand(cmd *cobra.Command, deps commandDeps, checkOnly bool) error {
78 manager, err := resolveUpdateManager(deps)

Callers 1

newRootCommandFunction · 0.85

Calls 1

runUpdateCommandFunction · 0.85

Tested by

no test coverage detected