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:
commit
ff7b9534f6
@ -468,9 +468,7 @@ module Cask
|
|||||||
trashed = trashed.split(":")
|
trashed = trashed.split(":")
|
||||||
untrashable = untrashable.split(":")
|
untrashable = untrashable.split(":")
|
||||||
|
|
||||||
return trashed, untrashable if untrashable.empty?
|
trashed_with_permissions, untrashable = untrashable.partition do |path|
|
||||||
|
|
||||||
untrashable.delete_if do |path|
|
|
||||||
Utils.gain_permissions(path, ["-R"], SystemCommand) do
|
Utils.gain_permissions(path, ["-R"], SystemCommand) do
|
||||||
system_command! HOMEBREW_LIBRARY_PATH/"cask/utils/trash.swift",
|
system_command! HOMEBREW_LIBRARY_PATH/"cask/utils/trash.swift",
|
||||||
args: [path],
|
args: [path],
|
||||||
@ -482,6 +480,10 @@ module Cask
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
trashed += trashed_with_permissions
|
||||||
|
|
||||||
|
return trashed, untrashable if untrashable.empty?
|
||||||
|
|
||||||
opoo "The following files could not be trashed, please do so manually:"
|
opoo "The following files could not be trashed, please do so manually:"
|
||||||
$stderr.puts untrashable
|
$stderr.puts untrashable
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user