MCPcopy Create free account
hub / github.com/AdRoll/baker / CreateIfNotExists

Function CreateIfNotExists

testutil/dir.go:77–87  ·  view source on GitHub ↗
(dir string, perm os.FileMode)

Source from the content-addressed store, hash-verified

75}
76
77func CreateIfNotExists(dir string, perm os.FileMode) error {
78 if Exists(dir) {
79 return nil
80 }
81
82 if err := os.MkdirAll(dir, perm); err != nil {
83 return fmt.Errorf("failed to create directory: '%s', error: '%s'", dir, err.Error())
84 }
85
86 return nil
87}

Callers 1

CopyDirectoryFunction · 0.85

Calls 2

ExistsFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected