aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorcommitay2017-04-20 14:38:16 +1000
committerMarkus Reiter2017-04-21 14:52:35 +0200
commit7d9513130b525ae950214407be77083d97d31d9a (patch)
treecc42cc8f709690a724cf7915a1ab110b447f68a6 /Library/Homebrew/cask/lib
parent12fe8957499f80d2ae74102d9222cec8fd81ce43 (diff)
downloadbrew-7d9513130b525ae950214407be77083d97d31d9a.tar.bz2
Replace `FileUtils.chmod` with `/bin/chmod` for cask binaries. [WIP]
Update binary.rb Update binary.rb Update binary.rb
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..f41b1b85b 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!.run("/bin/chmod", args: ["+x", source], sudo: true)
+ end
end
end
end