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

Function writeFile

pkg/cmd/extension/manager.go:723–730  ·  view source on GitHub ↗
(p string, contents []byte, mode os.FileMode)

Source from the content-addressed store, hash-verified

721}
722
723func writeFile(p string, contents []byte, mode os.FileMode) error {
724 if dir := filepath.Dir(p); dir != "." {
725 if err := os.MkdirAll(dir, 0755); err != nil {
726 return err
727 }
728 }
729 return os.WriteFile(p, contents, mode)
730}
731
732// reads the product of makeSymlink on Windows
733func readPathFromFile(path string) (string, error) {

Callers 3

CreateMethod · 0.85
otherBinScaffoldingMethod · 0.85
goBinScaffoldingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected