MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / createFolder

Function createFolder

core/cmd/server/cmd/app.go:119–128  ·  view source on GitHub ↗
(dirPath string)

Source from the content-addressed store, hash-verified

117}
118
119func createFolder(dirPath string) error {
120 if _, err := os.Stat(dirPath); err == nil {
121 return nil
122 }
123 if err := os.MkdirAll(dirPath, 0755); err != nil {
124 fmt.Println(i18n.GetMsgWithMapForCmd("AppCreateDirErr", map[string]interface{}{"name": dirPath, "err": err.Error()}))
125 return err
126 }
127 return nil
128}
129
130func writeFile(filePath string, in io.Reader) error {
131 data, err := io.ReadAll(in)

Callers 1

app.goFile · 0.85

Calls 3

MkdirAllMethod · 0.80
StatMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected