MCPcopy
hub / github.com/cli/cli / getStateEntry

Function getStateEntry

internal/update/update.go:138–151  ·  view source on GitHub ↗
(stateFilePath string)

Source from the content-addressed store, hash-verified

136}
137
138func getStateEntry(stateFilePath string) (*StateEntry, error) {
139 content, err := os.ReadFile(stateFilePath)
140 if err != nil {
141 return nil, err
142 }
143
144 var stateEntry StateEntry
145 err = yaml.Unmarshal(content, &stateEntry)
146 if err != nil {
147 return nil, err
148 }
149
150 return &stateEntry, nil
151}
152
153func setStateEntry(stateFilePath string, t time.Time, r ReleaseInfo) error {
154 data := StateEntry{CheckedForUpdateAt: t, LatestRelease: r}

Callers 3

CheckForExtensionUpdateFunction · 0.85
CheckForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by 1