homebrew-core/Formula/azure-cli.rb

38 lines
1.5 KiB
Ruby
Raw Normal View History

class AzureCli < Formula
desc "Official Azure CLI"
homepage "https://github.com/azure/azure-xplat-cli"
url "https://github.com/azure/azure-xplat-cli/releases/download/v0.9.13-December2015/azure-cli.0.9.13.tar.gz"
sha256 "f91e341c499624d6ba007ef3ad79d932c5b94a1f35acc49e3fbffd76c2317317"
head "https://github.com/azure/azure-xplat-cli.git", :branch => "dev"
2015-12-11 00:28:53 +00:00
bottle do
cellar :any_skip_relocation
2015-12-14 19:45:17 +00:00
revision 1
sha256 "ece78be41a76a480c8578098fe3a10e1db32259ad6b2007e2bf21db0cffd4ddc" => :el_capitan
sha256 "f72ee827bd18549ae59a7173d1c20ac8f21c2b42fd842fbeb7ae4ba1f587e6a3" => :yosemite
sha256 "17b053270b261c16eadbb1a1103a301237b44577d4e062ac81623a8785ef9c21" => :mavericks
2015-12-11 00:28:53 +00:00
end
depends_on "node"
def install
ENV.prepend_path "PATH", "#{Formula["node"].opt_libexec}/npm/bin"
# install node dependencies
system "npm", "install"
# remove windows stuff
rm_rf "bin/windows"
(prefix/"src").install Dir["lib", "node_modules", "package.json", "bin"]
bin.install_symlink (prefix/"src/bin/azure")
(bash_completion/"azure").write `#{bin}/azure --completion`
end
test do
json_text = shell_output("#{bin}/azure account env show AzureCloud --json")
azure_cloud = Utils::JSON.load(json_text)
assert_equal azure_cloud["name"], "AzureCloud"
assert_equal azure_cloud["managementEndpointUrl"], "https://management.core.windows.net"
assert_equal azure_cloud["resourceManagerEndpointUrl"], "https://management.azure.com/"
end
end