Merge pull request #18904 from Homebrew/update-cask-uninstall-trash-messaging

cask/artifact/abstract_uninstall: handle sudo trashed paths correctly
This commit is contained in:
Mike McQuaid 2024-12-09 09:11:14 +00:00 committed by GitHub
commit ff7b9534f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -468,9 +468,7 @@ module Cask
trashed = trashed.split(":")
untrashable = untrashable.split(":")
return trashed, untrashable if untrashable.empty?
untrashable.delete_if do |path|
trashed_with_permissions, untrashable = untrashable.partition do |path|
Utils.gain_permissions(path, ["-R"], SystemCommand) do
system_command! HOMEBREW_LIBRARY_PATH/"cask/utils/trash.swift",
args: [path],
@ -482,6 +480,10 @@ module Cask
false
end
trashed += trashed_with_permissions
return trashed, untrashable if untrashable.empty?
opoo "The following files could not be trashed, please do so manually:"
$stderr.puts untrashable