From 7516cee3741afb4a8f084716185024c42d417f5a Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Thu, 12 Dec 2013 08:21:22 -0800 Subject: [PATCH] +x wrapper scripts, so they work during post-install --- Library/Homebrew/extend/pathname.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 30cb44d98e..796a2e4912 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -377,22 +377,27 @@ class Pathname targets.flatten! if targets.empty? opoo "tried to write exec scripts to #{self} for an empty list of targets" + return end targets.each do |target| target = Pathname.new(target) # allow pathnames or strings (self+target.basename()).write <<-EOS.undent - #!/bin/bash - exec "#{target}" "$@" + #!/bin/bash + exec "#{target}" "$@" EOS + # +x here so this will work during post-install as well + (self+target.basename()).chmod 0644 end end # Writes an exec script that invokes a java jar def write_jar_script target_jar, script_name, java_opts="" (self+script_name).write <<-EOS.undent - #!/bin/bash - exec java #{java_opts} -jar #{target_jar} "$@" + #!/bin/bash + exec java #{java_opts} -jar #{target_jar} "$@" EOS + # +x here so this will work during post-install as well + (self+script_name).chmod 0644 end def install_metafiles from=nil