MCPcopy Create free account
hub / github.com/cli/cli / setStateEntry

Function setStateEntry

internal/update/update.go:164–178  ·  view source on GitHub ↗
(stateFilePath string, t time.Time, r ReleaseInfo)

Source from the content-addressed store, hash-verified

162}
163
164func setStateEntry(stateFilePath string, t time.Time, r ReleaseInfo) error {
165 data := StateEntry{CheckedForUpdateAt: t, LatestRelease: r}
166 content, err := yaml.Marshal(data)
167 if err != nil {
168 return err
169 }
170
171 err = os.MkdirAll(filepath.Dir(stateFilePath), 0755)
172 if err != nil {
173 return err
174 }
175
176 err = os.WriteFile(stateFilePath, content, 0600)
177 return err
178}
179
180func versionGreaterThan(v, w string) bool {
181 w = gitDescribeSuffixRE.ReplaceAllStringFunc(w, func(m string) string {

Callers 3

CheckForExtensionUpdateFunction · 0.85
CheckForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by 1