aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/xmlsh.rb
blob: caf16792d1781ebe6d252b8a50bebec3bb1ce148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "formula"

class Xmlsh < Formula
  homepage "http://www.xmlsh.org"
  url "https://downloads.sourceforge.net/project/xmlsh/xmlsh/1.2.5/xmlsh_1_2_5.zip"
  sha1 "3bce1c66eab4795f24abec56c025fd184a5321c4"

  def install
    rm_rf %w[win32 cygwin]
    libexec.install Dir["*"]
    chmod 0755, "#{libexec}/unix/xmlsh"
    (bin/"xmlsh").write <<-EOS.undent
      #!/bin/bash
      export XMLSH=#{libexec}
      exec #{libexec}/unix/xmlsh "$@"
    EOS
  end

  test do
    out = `#{bin}/xmlsh -c 'x=<[<foo bar="baz" />]> && echo <[$x/@bar]>'`
    assert_equal "baz\n", out
    assert_equal 0, $?.exitstatus
  end
end