diff options
| author | Jack Nagel | 2014-04-03 23:58:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-03 23:58:40 -0500 |
| commit | 43083c7ae13bfeaf91a69d6998adf051b48efccb (patch) | |
| tree | 474d4591eddeb35a6b47a7c2d5cab86afbf13cfb /Library | |
| parent | 8677948a6c80d9332d7f8b3e21d45b2502d040f3 (diff) | |
| download | homebrew-43083c7ae13bfeaf91a69d6998adf051b48efccb.tar.bz2 | |
xmlsh: simplify
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/xmlsh.rb | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/Library/Formula/xmlsh.rb b/Library/Formula/xmlsh.rb index bc385345a..efdd4fbf3 100644 --- a/Library/Formula/xmlsh.rb +++ b/Library/Formula/xmlsh.rb @@ -5,38 +5,14 @@ class Xmlsh < Formula url 'https://downloads.sourceforge.net/project/xmlsh/xmlsh/1.2.4/xmlsh_1_2_4.zip' sha1 'ef11e6fa3d72d99b78331a4ab58a22b1ad08b4ef' - def shim_script target - <<-EOS.undent - #!/usr/bin/env bash - - # Used to set up classpaths - # - # Bash default variable values syntax: - # http://wiki.bash-hackers.org/syntax/pe#use_a_default_value - XMLSH=${XMLSH:-#{libexec}} && export XMLSH - - # Use XDG_CONFIG_HOME if it exists; - # Otherwise HOME - CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME} - - # Set up - XMLSHRC=${CONFIG_HOME}/.xmlshrc - - # Execute unix script - ${XMLSH}/unix/xmlsh -rcfile ${XMLSHRC} - EOS - end - def install + rm_rf %w[win32 cygwin] libexec.install Dir["*"] - - # remove windows files - system "rm", "-rf", "#{libexec}/win32", "#{libexec}/cygwin" - - # make the unix executable...um, executable. - system "chmod", "a+x", "#{libexec}/unix/xmlsh" - - # Write mini-script to run as executable instead of `jar blah blah...` - (bin/'xmlsh').write shim_script('xmlsh') + chmod 0755, "#{libexec}/unix/xmlsh" + (bin/"xmlsh").write <<-EOS.undent + #!/bin/bash + export XMLSH=#{libexec} + exec #{libexec}/unix/xmlsh "$@" + EOS end end |
