diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 0abea4b874..8e47348b42 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -328,10 +328,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 @@ -344,6 +346,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 @@ -367,6 +370,7 @@ class Pathname #!/bin/bash #{java_home}exec java #{java_opts} -jar #{target_jar} "$@" SH + chmod 0555 end def install_metafiles(from = Pathname.pwd)