diff --git a/cmd/common/file.go b/cmd/common/file.go index 06590cd..a848cc7 100644 --- a/cmd/common/file.go +++ b/cmd/common/file.go @@ -11,9 +11,13 @@ import ( ) func CreateFolder(folderPath string) { + folder, err := os.Stat(folderPath) + if err == nil && folder.IsDir() { // folder exist -> skip create process + return + } log.Debugf("Create folder -> %s", folderPath) if err := os.MkdirAll(folderPath, 0755); err != nil { - log.Panicf("Failed to create folder -> %s", folderPath) + log.Errorf("Failed to create folder -> %s", folderPath) } }