Skip to content

Commit 3d0a97c

Browse files
committed
granted: install shell wrappers and assumego symlink
The formula was only installing the granted binary. This left the package non-functional because the assume workflow requires three additional components that weren't being installed. The assume script is a POSIX shell wrapper that calls assumego and exports AWS credentials into the current shell environment. The assume.fish script does the same for fish shell. The assumego binary is accessed via symlink to the granted binary - the code checks argv[0] to determine behavior. Without these components, users couldn't actually assume AWS roles because the credentials wouldn't propagate to their shell session. This adds installation of scripts/assume and scripts/assume.fish from the source tree, and creates the assumego -> granted symlink during the install phase.
1 parent 3bd4913 commit 3d0a97c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Formula/g/granted.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class Granted < Formula
2020
def install
2121
ldflags = "-s -w -X github.com/common-fate/granted/internal/build.Version=#{version}"
2222
system "go", "build", *std_go_args(ldflags:), "./cmd/granted"
23+
24+
# Install shell wrapper scripts
25+
bin.install "scripts/assume"
26+
bin.install "scripts/assume.fish"
27+
28+
# Create assumego symlink
29+
bin.install_symlink "granted" => "assumego"
2330
end
2431

2532
test do

0 commit comments

Comments
 (0)