Skip to content

Instantly share code, notes, and snippets.

@alanivey
Created October 29, 2018 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanivey/c953c2997728fca4fc9441ec208e65a2 to your computer and use it in GitHub Desktop.
Save alanivey/c953c2997728fca4fc9441ec208e65a2 to your computer and use it in GitHub Desktop.
aws_assume_role with brew-gem
# Background: aws_assume_role 1.2.1 fails to install in brew-gem by default with an error about being unable to
# find `rake`. The following is a crude hack/workaround:
brew install brew-gem ruby
AAR_BREWGEM_TMPDIR="$( mktemp -d 2>/dev/null || mktemp -d -t 'AAR_brewgem_tmpdir' )"
brew gem formula aws_assume_role 1.2.1 --homebrew-ruby | sed -e 's/\(cached_download\)/"rake", \1/' > "${AAR_BREWGEM_TMPDIR%/}/gem-aws_assume_role.rb"
HOMEBREW_NO_AUTO_UPDATE=1 brew install "${AAR_BREWGEM_TMPDIR%/}/gem-aws_assume_role.rb"
rm -r "${AAR_BREWGEM_TMPDIR:?}"
unset AAR_BREWGEM_TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment