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.
This commit is contained in:
Joan Bruguera 2022-12-21 09:09:59 +00:00 committed by GitHub
parent 9a23b792c4
commit 2bda76e431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))
}
}