From 3598652116dfbfa71db3cc15cf2c6ce06f486f8a Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Fri, 13 Jul 2018 21:18:58 -0400 Subject: [PATCH] Explicitly chmod exec script files --- Library/Homebrew/extend/pathname.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 3f26cc1833..4d8c20958d 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -351,10 +351,12 @@ class Pathname mkpath targets.each do |target| target = Pathname.new(target) # allow pathnames or strings - join(target.basename).write <<~SH + script = join(target.basename) + script.write <<~SH #!/bin/bash exec "#{target}" "$@" SH + script.chmod 0555 end end @@ -367,6 +369,7 @@ class Pathname #!/bin/bash #{env_export}exec "#{target}" "$@" SH + chmod 0555 end # Writes a wrapper env script and moves all files to the dst @@ -390,6 +393,7 @@ class Pathname #!/bin/bash #{java_home}exec java #{java_opts} -jar #{target_jar} "$@" SH + chmod 0555 end def install_metafiles(from = Pathname.pwd)