dev: automated commit - 2025-06-04 15:56:59

This commit is contained in:
Mariano Z. 2025-06-04 15:57:01 -03:00
parent aa573c4ebc
commit b754d49861
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
3 changed files with 39 additions and 3 deletions

View file

@ -361,7 +361,11 @@ func executeScript(script Script, args []string, verbose bool) error {
}
func createNewScript(scriptName string) error {
if err := os.MkdirAll(config.RunsDir, 0o755); err != nil {
scriptPath := filepath.Join(config.RunsDir, scriptName)
dirPath := filepath.Dir(scriptPath)
if err := os.MkdirAll(dirPath, 0o755); err != nil {
return err
}
@ -369,8 +373,6 @@ func createNewScript(scriptName string) error {
scriptName += ".sh"
}
scriptPath := filepath.Join(config.RunsDir, scriptName)
if _, err := os.Stat(scriptPath); err == nil {
return fmt.Errorf("script %s already exists", scriptName)
}