Browse Source

fix(clean): notify RemoveAll error when cleaning AUR (#1863)

otherwise if any hard-to-delete file lands in the AUR cache folder, running
`yay -Scc` will appear to succeed to the user, but actually abort midway.
Joan Bruguera 2 years ago
parent
commit
2bda76e431
1 changed files with 3 additions and 2 deletions
  1. 3 2
      clean.go

+ 3 - 2
clean.go

@@ -154,9 +154,10 @@ func cleanAUR(ctx context.Context, keepInstalled, keepCurrent, removeAll bool, d
 			}
 		}
 
-		err = os.RemoveAll(filepath.Join(config.BuildDir, file.Name()))
+		dir := filepath.Join(config.BuildDir, file.Name())
+		err = os.RemoveAll(dir)
 		if err != nil {
-			return nil
+			text.Warnln(gotext.Get("Unable to remove %s: %s", dir, err))
 		}
 	}