class Pulumi < Formula desc "Cloud native development platform" homepage "https://pulumi.io/" url "https://github.com/pulumi/pulumi.git", :tag => "v0.17.21", :revision => "29320af68beed0cf48cff5ad72c9e541c86b252d" bottle do cellar :any_skip_relocation sha256 "a7cd3180485d5553cc3e9ee5f475bc43d5c46797cd2feb42aaa32b8eacfde7c6" => :mojave sha256 "c6ec567e1efa079f313361d1701fe01bf3c4a58bf7c50f16897ccef5efb8cd75" => :high_sierra sha256 "d0b0422e0a23a354e8ee6b890c90fac0c674e014d851a98467975adaa62ec96d" => :sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath ENV["GO111MODULE"] = "on" dir = buildpath/"src/github.com/pulumi/pulumi" dir.install buildpath.children cd dir do system "go", "mod", "vendor" system "make", "dist" bin.install Dir["#{buildpath}/bin/*"] prefix.install_metafiles # Install bash completion output = Utils.popen_read("#{bin}/pulumi gen-completion bash") (bash_completion/"pulumi").write output # Install zsh completion output = Utils.popen_read("#{bin}/pulumi gen-completion zsh") (zsh_completion/"_pulumi").write output end end test do ENV["PULUMI_ACCESS_TOKEN"] = "local://" ENV["PULUMI_TEMPLATE_PATH"] = testpath/"templates" system "#{bin}/pulumi", "new", "aws-typescript", "--generate-only", "--force", "-y" assert_predicate testpath/"Pulumi.yaml", :exist?, "Project was not created" end end