+x wrapper scripts, so they work during post-install

This commit is contained in:
Adam Vandenberg 2013-12-12 08:21:22 -08:00
parent 5c18054341
commit 7516cee374

View File

@ -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