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

Function writeFile

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

Source from the content-addressed store, hash-verified

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