MCPcopy
hub / github.com/cli/cli / writeFile

Function writeFile

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

Source from the content-addressed store, hash-verified

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