MCPcopy
hub / github.com/cli/cli / setStateEntry

Function setStateEntry

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

Source from the content-addressed store, hash-verified

151}
152
153func setStateEntry(stateFilePath string, t time.Time, r ReleaseInfo) error {
154 data := StateEntry{CheckedForUpdateAt: t, LatestRelease: r}
155 content, err := yaml.Marshal(data)
156 if err != nil {
157 return err
158 }
159
160 err = os.MkdirAll(filepath.Dir(stateFilePath), 0755)
161 if err != nil {
162 return err
163 }
164
165 err = os.WriteFile(stateFilePath, content, 0600)
166 return err
167}
168
169func versionGreaterThan(v, w string) bool {
170 w = gitDescribeSuffixRE.ReplaceAllStringFunc(w, func(m string) string {

Callers 3

CheckForExtensionUpdateFunction · 0.85
CheckForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by 1