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

Function runUpdateCommand

internal/cli/update.go:77–96  ·  view source on GitHub ↗
(cmd *cobra.Command, deps commandDeps, checkOnly bool)

Source from the content-addressed store, hash-verified

75}
76
77func runUpdateCommand(cmd *cobra.Command, deps commandDeps, checkOnly bool) error {
78 manager, err := resolveUpdateManager(deps)
79 if err != nil {
80 return err
81 }
82
83 state, release, err := manager.Check(cmd.Context(), aghupdate.CheckOptions{
84 ForceRefresh: true,
85 AllowCachedOnFailure: false,
86 })
87 record := updateRecordFromState(state)
88 if err != nil {
89 return writeUpdateFailure(cmd, record, err)
90 }
91 if checkOnly || state.Status != aghupdate.StatusAvailable {
92 return writeCommandOutput(cmd, updateBundle(record))
93 }
94
95 return applyAvailableUpdate(cmd, deps, manager, release, record)
96}
97
98func resolveUpdateManager(deps commandDeps) (updateManager, error) {
99 homePaths, err := deps.resolveHome()

Callers 1

newUpdateCommandFunction · 0.85

Calls 7

resolveUpdateManagerFunction · 0.85
updateRecordFromStateFunction · 0.85
writeUpdateFailureFunction · 0.85
writeCommandOutputFunction · 0.85
updateBundleFunction · 0.85
applyAvailableUpdateFunction · 0.85
CheckMethod · 0.65

Tested by

no test coverage detected