Skip to content

Commit a8c3296

Browse files
committed
fix(pkg/filesystem): fix an edge case in the fileCreatorCleaner
1 parent 7224b96 commit a8c3296

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/commands/run.go

+6
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ func (s *fileCreatorCleaner) MkdirAndWriteFile(path string, data []byte, dirPerm
275275
func (s *fileCreatorCleaner) Clean() error {
276276
for i := len(s.filesToClean) - 1; i >= 0; i-- {
277277
if err := filesystem.FS.Remove(s.filesToClean[i]); err != nil {
278+
if errors.Is(err, os.ErrNotExist) {
279+
continue
280+
}
278281
return err
279282
}
280283
}
@@ -288,6 +291,9 @@ func (s *fileCreatorCleaner) Clean() error {
288291
if errors.As(err, &pathErr) && pathErr.Err == syscall.ENOTEMPTY {
289292
continue
290293
}
294+
if errors.Is(err, os.ErrNotExist) {
295+
continue
296+
}
291297
return err
292298
}
293299
}

0 commit comments

Comments
 (0)