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

Function finishLocalUpdate

internal/cli/update.go:145–161  ·  view source on GitHub ↗
(
	cmd *cobra.Command,
	manager updateManager,
	applied aghupdate.AppliedBinary,
	release *aghupdate.Release,
	record updateRecord,
)

Source from the content-addressed store, hash-verified

143}
144
145func finishLocalUpdate(
146 cmd *cobra.Command,
147 manager updateManager,
148 applied aghupdate.AppliedBinary,
149 release *aghupdate.Release,
150 record updateRecord,
151) error {
152 if err := manager.Finalize(applied); err != nil {
153 record.Status = string(aghupdate.StatusFailed)
154 record.Message = err.Error()
155 return writeUpdateFailure(cmd, record, err)
156 }
157 record.Status = string(aghupdate.StatusUpdated)
158 record.CurrentVersion = strings.TrimSpace(release.Version)
159 record.Message = "Updated AGH to " + strings.TrimSpace(release.Version) + "."
160 return writeCommandOutput(cmd, updateBundle(record))
161}
162
163func restartDaemonAfterUpdate(
164 cmd *cobra.Command,

Callers 1

applyAvailableUpdateFunction · 0.85

Calls 5

writeUpdateFailureFunction · 0.85
writeCommandOutputFunction · 0.85
updateBundleFunction · 0.85
FinalizeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected