MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / checkWritePermission

Function checkWritePermission

internal/update/update.go:230–238  ·  view source on GitHub ↗

checkWritePermission checks if we can write to the directory.

(dir string)

Source from the content-addressed store, hash-verified

228
229// checkWritePermission checks if we can write to the directory.
230func checkWritePermission(dir string) error {
231 tmp, err := os.CreateTemp(dir, ".chief-update-check-*")
232 if err != nil {
233 return err
234 }
235 tmp.Close()
236 os.Remove(tmp.Name())
237 return nil
238}
239
240// downloadToTemp downloads a URL to a temporary file in the specified directory.
241func downloadToTemp(url, dir string) (string, error) {

Callers 3

PerformUpdateFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by 2