diff options
| author | Adam Vandenberg | 2013-12-12 08:21:22 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2013-12-12 08:21:22 -0800 |
| commit | 7516cee3741afb4a8f084716185024c42d417f5a (patch) | |
| tree | cd6b548555dfef9f1673e18dcffdbe14c568717d /Library | |
| parent | 5c1805434173002c5da18a91a1cd3158661a5424 (diff) | |
| download | brew-7516cee3741afb4a8f084716185024c42d417f5a.tar.bz2 | |
+x wrapper scripts, so they work during post-install
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 30cb44d98..796a2e491 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 |
