+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,6 +377,7 @@ class Pathname
targets.flatten! targets.flatten!
if targets.empty? if targets.empty?
opoo "tried to write exec scripts to #{self} for an empty list of targets" opoo "tried to write exec scripts to #{self} for an empty list of targets"
return
end end
targets.each do |target| targets.each do |target|
target = Pathname.new(target) # allow pathnames or strings target = Pathname.new(target) # allow pathnames or strings
@ -384,6 +385,8 @@ class Pathname
#!/bin/bash #!/bin/bash
exec "#{target}" "$@" exec "#{target}" "$@"
EOS EOS
# +x here so this will work during post-install as well
(self+target.basename()).chmod 0644
end end
end end
@ -393,6 +396,8 @@ class Pathname
#!/bin/bash #!/bin/bash
exec java #{java_opts} -jar #{target_jar} "$@" exec java #{java_opts} -jar #{target_jar} "$@"
EOS EOS
# +x here so this will work during post-install as well
(self+script_name).chmod 0644
end end
def install_metafiles from=nil def install_metafiles from=nil