We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cda9a4c commit 968521fCopy full SHA for 968521f
pkg/paths/paths.go
@@ -60,6 +60,11 @@ func AdvertiseCachedFile(src, dst string) error {
60
}
61
// Broken symlink (Lstat succeeded but Stat failed) - remove it.
62
if err := os.Remove(dst); err != nil {
63
+ if errors.Is(err, os.ErrNotExist) {
64
+ // Race condition: something removed it between our Lstat and Remove.
65
+ // Re-run to handle it properly.
66
+ return AdvertiseCachedFile(src, dst)
67
+ }
68
return fmt.Errorf("removing broken symlink %s: %w", dst, err)
69
70
0 commit comments