@@ -7,25 +7,40 @@ class Granted < Formula
77 head "https://github.com/fwdcloudsec/granted.git" , branch : "main"
88
99 bottle do
10- sha256 cellar : :any_skip_relocation , arm64_tahoe : "905d6f692d85563eca73585449c2936f5086ce5cc1cc1e101a3bcd71ecf1e8f0"
11- sha256 cellar : :any_skip_relocation , arm64_sequoia : "826f554acd21683c694d7b3ab363aee7a5339b9f488c8672b723494557dda323"
12- sha256 cellar : :any_skip_relocation , arm64_sonoma : "4d6a65dc8bcb372ebbbdaee1ce5d47f14adec08b67b2ff8d6a6c28da6d29e8ad"
13- sha256 cellar : :any_skip_relocation , sonoma : "2082c978cba759a2f55bcaa9e1afe102dc6bd03687deba376b075b043158358a"
14- sha256 cellar : :any_skip_relocation , arm64_linux : "9ecdd52db4973da236d1317fbcd89309dd0ec5e36da27515463e29383ac423fa"
15- sha256 cellar : :any_skip_relocation , x86_64_linux : "bf9dfb7396fd9de587fabb3b7fa0246efdf9155a5c2ed32cf5ec2fab0d27848c"
10+ rebuild 1
11+ sha256 cellar : :any_skip_relocation , arm64_tahoe : "b2ae7e586190f7c5092da72f5e510a4c280b55c114975e39a9b5ca500ef5f601"
12+ sha256 cellar : :any_skip_relocation , arm64_sequoia : "fc90ac61d24f078333207f04e4750cbb0be674734ad42ee2f1c3d449069f7d95"
13+ sha256 cellar : :any_skip_relocation , arm64_sonoma : "f72bc786bb6f5e3bd0d23150d07c1f9a889d06b42a728589114ebb418b3bd505"
14+ sha256 cellar : :any_skip_relocation , sonoma : "ad6688f253dd0a2440dd3e3a4201bdfd729e77ef33b62e33668961c63bbe7386"
15+ sha256 cellar : :any_skip_relocation , arm64_linux : "eaf45439a1a8f236a254b8db441fada6c8813b314ed479aa65f201be47b031dc"
16+ sha256 cellar : :any_skip_relocation , x86_64_linux : "534d96a5ee4e3075598d6be97a10c2df041a4fcf6f95f3498299fd9a777a0130"
1617 end
1718
1819 depends_on "go" => :build
1920
2021 def install
2122 ldflags = "-s -w -X github.com/common-fate/granted/internal/build.Version=#{ version } "
2223 system "go" , "build" , *std_go_args ( ldflags :) , "./cmd/granted"
24+ bin . install_symlink "granted" => "assumego"
25+ # these must be in bin, and not sourced automatically
26+ bin . install "scripts/assume"
27+ bin . install "scripts/assume.fish"
2328 end
2429
2530 test do
2631 assert_match version . to_s , shell_output ( "#{ bin } /granted --version" )
2732
2833 output = shell_output ( "#{ bin } /granted auth configure 2>&1" , 1 )
2934 assert_match "[✘] please provide a url argument" , output
35+
36+ ENV [ "GRANTED_ALIAS_CONFIGURED" ] = "true"
37+ assert_match version . to_s , shell_output ( "#{ bin } /assume --version" )
38+ assert_match version . to_s , shell_output ( "#{ bin } /assumego --version" )
39+
40+ # assume is interactive; pipe_output provides empty stdin causing prompts to fail.
41+ # Match varies by environment: "does not match" (with browser), "Could not find
42+ # default browser" (no browser configured), or "EOF" (when stdin closes).
43+ output = pipe_output ( "#{ bin } /assume non-existing-role 2>&1" , "" )
44+ assert_match ( /does not match any profiles|Could not find default browser|EOF/ , output )
3045 end
3146end
0 commit comments