homebrew-core/Formula/awscli.rb
2017-05-25 01:05:55 -07:00

42 lines
1.5 KiB
Ruby

class Awscli < Formula
include Language::Python::Virtualenv
desc "Official Amazon AWS command-line interface"
homepage "https://aws.amazon.com/cli/"
url "https://github.com/aws/aws-cli/archive/1.11.92.tar.gz"
sha256 "872aba7492c39749229865170b807b9320d8766d5a23ef992138f01b315ff3b0"
head "https://github.com/aws/aws-cli.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "0645af9f95f8e4b684b0bc56dcb424efb89f0de89101a37ff1272edd789ce263" => :sierra
sha256 "d94b9a36aeb9d8473dbb47a93b0b687c982a77fea985fa63977f43e6f72d8369" => :el_capitan
sha256 "666196863744d9b9c992e34d8488607c7bf4ecdc50877df2e7e665ef1e08f900" => :yosemite
end
# Use :python on Lion to avoid urllib3 warning
# https://github.com/Homebrew/homebrew/pull/37240
depends_on :python if MacOS.version <= :lion
def install
venv = virtualenv_create(libexec)
system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
"--ignore-installed", buildpath
system libexec/"bin/pip", "uninstall", "-y", "awscli"
venv.pip_install_and_link buildpath
pkgshare.install "awscli/examples"
bash_completion.install "bin/aws_bash_completer"
zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws"
end
def caveats; <<-EOS.undent
The "examples" directory has been installed to:
#{HOMEBREW_PREFIX}/share/awscli/examples
EOS
end
test do
assert_match "topics", shell_output("#{bin}/aws help")
end
end