diff --git a/action/filesystem/filesystem.go b/action/filesystem/filesystem.go index ffa52d49..154f590e 100644 --- a/action/filesystem/filesystem.go +++ b/action/filesystem/filesystem.go @@ -187,12 +187,9 @@ func SaveCurrentRunTime(pathLastRun string) error { // Create directory if needed dir := filepath.Dir(pathLastRun) - err := CheckFileExists(dir) - if errors.Is(err, os.ErrNotExist) { - err = os.MkdirAll(dir, os.ModePerm) - if err != nil { - return err - } + err := os.MkdirAll(dir, os.ModePerm) + if err != nil { + return err } // Write the current time into file diff --git a/action/recipes/recipes.go b/action/recipes/recipes.go index 39ac2715..a6f53f33 100644 --- a/action/recipes/recipes.go +++ b/action/recipes/recipes.go @@ -169,12 +169,9 @@ func IsDirEmpty(path string) (bool, error) { // func Execute(ctx context.Context, target string, config *Config, interactive bool, bulldozeMode bool) error { func Execute(ctx context.Context, target string, config *Config, interactive bool) error { // Prep - _, err := os.Stat(TimestampsDir) + err := os.MkdirAll(TimestampsDir, os.ModePerm) if err != nil { - err = os.MkdirAll(TimestampsDir, os.ModePerm) - if err != nil { - return err - } + return err } // Find requested target