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

Function setStateEntry

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

Source from the content-addressed store, hash-verified

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

Callers 3

CheckForExtensionUpdateFunction · 0.85
CheckForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by 1