Files
tigerbrew/Library/Formula/juju.rb
T
Curtis Hovey c88340781d juju 1.16.4
Closes #24931.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-12-04 20:03:29 -08:00

35 lines
919 B
Ruby

require 'formula'
class Juju < Formula
homepage 'https://juju.ubuntu.com'
url 'https://launchpad.net/juju-core/1.16/1.16.4/+download/juju-core_1.16.4.tar.gz'
sha1 '17732fca4a4ec0f27370b0c9c755f3c9d712eaea'
depends_on 'go' => :build
def install
ENV['GOPATH'] = buildpath
args = %w(install launchpad.net/juju-core/cmd/juju)
args.insert(1, "-v") if ARGV.verbose?
system "go", *args
bin.install 'bin/juju'
(bash_completion/'juju-completion.bash').write <<-EOS.undent
_juju()
{
local cur prev options files targets
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
actions=$(juju help commands 2>/dev/null | awk '{print $1}')
COMPREPLY=( $( compgen -W "${actions}" -- ${cur} ) )
return 0
}
complete -F _juju juju
EOS
end
def test
system "#{bin}/juju", "version"
end
end