Skip to content

Commit

Permalink
Skip removeAllExcept if directory does not exist (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr authored Aug 30, 2024
1 parent 810776e commit 1bfea1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/konfluxgen/konfluxgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ func replace(input interface{}, old, new string) string {
}

func removeAllExcept(dir string, excludedFiles ...string) error {
if _, err := os.Stat(dir); err != nil {
// directory does not exist anyhow
return nil
}

return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
Expand Down

0 comments on commit 1bfea1d

Please sign in to comment.