cask/quarantine: fix quarantine not working under some setups

This commit is contained in:
Bo Anderson 2022-06-02 18:53:46 +01:00
parent 68043d4e72
commit 9c3359afa1
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -27,6 +27,11 @@ module Cask
end end
private :xattr private :xattr
def swift_target_args
["-target", "#{Hardware::CPU.arch}-apple-macosx#{MacOS.version}"]
end
private :swift_target_args
sig { returns(Symbol) } sig { returns(Symbol) }
def check_quarantine_support def check_quarantine_support
odebug "Checking quarantine support" odebug "Checking quarantine support"
@ -39,7 +44,7 @@ module Cask
:no_swift :no_swift
else else
api_check = system_command(swift, api_check = system_command(swift,
args: [QUARANTINE_SCRIPT], args: [*swift_target_args, QUARANTINE_SCRIPT],
print_stderr: false) print_stderr: false)
case api_check.exit_status case api_check.exit_status
@ -116,6 +121,7 @@ module Cask
quarantiner = system_command(swift, quarantiner = system_command(swift,
args: [ args: [
*swift_target_args,
QUARANTINE_SCRIPT, QUARANTINE_SCRIPT,
download_path, download_path,
cask.url.to_s, cask.url.to_s,