Skip to content

Commit 3486a41

Browse files
committed
feat: Add check for existing work directory in clean command
1 parent 44fc969 commit 3486a41

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

alteriso/src/internal/cmd/clean.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ func cleanCmd() *cobra.Command {
4949
Short: "Clean up working directories",
5050
RunE: func(cmd *cobra.Command, args []string) error {
5151

52+
if !futils.Exists(workDir) {
53+
slog.Info("Workdir does not exist, nothing to clean", "dir", workDir)
54+
return nil
55+
}
56+
5257
correctedWorkDir, ok := correctWorkDir(workDir)
5358
if !ok {
5459
return errors.Newf("workdir %s is not a valid directory", workDir)

0 commit comments

Comments
 (0)