Merge pull request #15968 from MikeMcQuaid/cask_upgrade_sudo_test_fix

cask/quarantine: don't try to sudo during tests.
This commit is contained in:
Mike McQuaid 2023-09-06 10:17:37 -04:00 committed by GitHub
commit d5d74788b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ module Cask
command.run!("/bin/cp", args: ["-pR", *source.children, target],
sudo: true)
end
Quarantine.copy_xattrs(source, target)
Quarantine.copy_xattrs(source, target, command: command)
source.rmtree
elsif target.dirname.writable?
FileUtils.move(source, target)

View File

@ -174,11 +174,11 @@ module Cask
raise CaskQuarantinePropagationError.new(to, quarantiner.stderr)
end
sig { params(from: Pathname, to: Pathname).void }
def self.copy_xattrs(from, to)
sig { params(from: Pathname, to: Pathname, command: T.class_of(SystemCommand)).void }
def self.copy_xattrs(from, to, command:)
odebug "Copying xattrs from #{from} to #{to}"
system_command!(
command.run!(
swift,
args: [
*swift_target_args,