refactor: change default output directory

This commit is contained in:
Mathis Maquenne
2025-04-26 00:49:56 +02:00
parent 7302685e34
commit 6675834842
4 changed files with 46 additions and 8 deletions
+21
View File
@@ -0,0 +1,21 @@
package utils
import (
"fmt"
"os"
)
func EnsureDir(path string) error {
info, err := os.Stat(path)
if os.IsNotExist(err) {
return os.MkdirAll(path, 0755)
}
if err != nil {
return err
}
if !info.IsDir() {
return fmt.Errorf("file already exists at %s", path)
}
return nil
}