aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-21 15:24:07 +0200
committerGitHub2017-04-21 15:24:07 +0200
commitcd110b467d76e0d93afc35785c769478b0ed6b32 (patch)
tree595dd893609c64f40d19c4d6cec2c95c2efdff20 /Library/Homebrew/cask/lib
parentcc7376246e6919b22456fb5bc114cf9cc3bf6667 (diff)
parent5c51c4e23b78acc2a87e0553e78e86d7083945a5 (diff)
downloadbrew-cd110b467d76e0d93afc35785c769478b0ed6b32.tar.bz2
Merge pull request #2512 from commitay/cask-binary
Replace `FileUtils.chmod` with `/bin/chmod` for cask binaries.
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/binary.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/binary.rb b/Library/Homebrew/cask/lib/hbc/artifact/binary.rb
index 06bdfe157..21d123ab9 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/binary.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/binary.rb
@@ -9,7 +9,12 @@ module Hbc
def link
super
- FileUtils.chmod "+x", source
+ return if source.executable?
+ if source.writable?
+ FileUtils.chmod "+x", source
+ else
+ @command.run!("/bin/chmod", args: ["+x", source], sudo: true)
+ end
end
end
end