Skip to content

Commit 8b34341

Browse files
fix(host-cleanup): fix fdopendir /Users/user/.werf/local_cache/git_repos/.DS_Store: not a directory
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
1 parent 9436cca commit 8b34341

File tree

1 file changed

+10
-0
lines changed
  • pkg/git_repo/gitdata

1 file changed

+10
-0
lines changed

pkg/git_repo/gitdata/gc.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,16 @@ WipeCacheDirs:
282282
}
283283

284284
versionedCacheDir := filepath.Join(cacheRootDir, finfo.Name())
285+
286+
if !finfo.IsDir() {
287+
logboek.Context(ctx).Warn().LogF("Removing invalid entry %q: not a directory\n", versionedCacheDir)
288+
if err := os.RemoveAll(versionedCacheDir); err != nil {
289+
return fmt.Errorf("unable to remove %q: %w", versionedCacheDir, err)
290+
}
291+
292+
continue
293+
}
294+
285295
subdirs, err := ioutil.ReadDir(versionedCacheDir)
286296
if err != nil {
287297
return fmt.Errorf("error reading dir %q: %w", versionedCacheDir, err)

0 commit comments

Comments
 (0)