Skip to content

Commit

Permalink
os/mac/keg: print stderr on codesign failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Feb 11, 2021
1 parent 980f928 commit 5202f71
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Library/Homebrew/os/mac/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ def apply_ad_hoc_signature(file)

# Try signing again
odebug "Codesigning (2nd try) #{file}"
return if quiet_system("codesign", "--sign", "-", "--force",
"--preserve-metadata=entitlements,requirements,flags,runtime",
file)
result = system_command("codesign", args: [
"--sign", "-", "--force",
"--preserve-metadata=entitlements,requirements,flags,runtime",
file
], print_stderr: false)
return if result.success?

# If it fails again, error out
onoe <<~EOS
Failed applying an ad-hoc signature to #{file}
Failed applying an ad-hoc signature to #{file}:
#{result.stderr}
EOS
end
end

0 comments on commit 5202f71

Please sign in to comment.