cask/quarantine: sudo correctly during tests.
Use `NeverSudoSystemCommand` and pass it through to `Quarantine.copy_xattrs` so `brew tests` doesn't try to `sudo`. Fixes #15958 Co-authored-by: Bo Anderson <mail@boanderson.me> Co-authored-by: Kevin <apainintheneck@gmail.com>
This commit is contained in:
parent
43295b2637
commit
58df7885e6
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user