homebrew-core/Formula/awscli.rb
2017-04-07 02:49:18 -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.74.tar.gz"
sha256 "fde692d97d2d322c028a0d3ab88cae34d4a8b1712d8260470ee389b3047e6fa9"
head "https://github.com/aws/aws-cli.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "7eaf25656daf2f65d333f68cdf13b3e35556bb0d8d1abf460818d10e15729022" => :sierra
sha256 "8d8778e6141fa73f4222d971f77ffb99676ff148944180777521214c3d85548a" => :el_capitan
sha256 "95c2ded67fe964f8e3ccbda66471a2a8e05055944b533284d8864cf919882a57" => :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