From ad462d320424c1ea6613d90da2271f1bb7b00e1b Mon Sep 17 00:00:00 2001 From: AtomicFS Date: Wed, 11 Dec 2024 14:24:49 +0100 Subject: [PATCH] chore(action): cosmetic fixes Signed-off-by: AtomicFS --- action/filesystem/filesystem.go | 9 +++------ action/recipes/recipes.go | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) 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