homebrew-core/Formula/awscli.rb
2016-11-12 02:57:31 -08:00

50 lines
1.8 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.14.tar.gz"
sha256 "c1c93f1324415d79bee5aec08362e35ef14fdb7ac12097930502f4de08ca658a"
head "https://github.com/aws/aws-cli.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "3a216e5dfe67a43fbfbbd9ff7f19535649bbffce143116cb49a4ba5d12faf944" => :sierra
sha256 "f09bd63ee9e971b10b54b07bb0484dad08fe12a032c6886912be340bd34ca194" => :el_capitan
sha256 "8c1b2b2f3268144b5feba3b3ec4a07113c844d254c2fb16d8ffb8599867b3dde" => :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
Before using aws-cli, you need to tell it about your AWS credentials.
The quickest way to do this is to run:
aws configure
More information:
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
https://pypi.python.org/pypi/awscli#getting-started
EOS
end
test do
assert_match "topics", shell_output("#{bin}/aws help")
end
end