From 7d9513130b525ae950214407be77083d97d31d9a Mon Sep 17 00:00:00 2001 From: commitay Date: Thu, 20 Apr 2017 14:38:16 +1000 Subject: Replace `FileUtils.chmod` with `/bin/chmod` for cask binaries. [WIP] Update binary.rb Update binary.rb Update binary.rb --- Library/Homebrew/cask/lib/hbc/artifact/binary.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Library') 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 -- cgit v1.2.3