homebrew-core/Formula/awscli.rb
2016-10-19 01:32:56 -07: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.7.tar.gz"
sha256 "b3a1f53b13084ca4e96516756bb1bf3d8393198c18d62d45db7d2b48b91063f1"
head "https://github.com/aws/aws-cli.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "25bbe0691be358d6feb2d58cf1620d5431009ff4a537fe8bf551d33bbb81af95" => :sierra
sha256 "384b5a070550c8b4961413d05d47f359baa1a5e6bc6e88bba2d73179f615b3e5" => :el_capitan
sha256 "7417b1ab05ab3fea045f05b51278c472e63d80e75acb12733353407959590bed" => :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