Skip to content

Instantly share code, notes, and snippets.

@Moulick
Created May 18, 2024 15:51
Show Gist options
  • Save Moulick/34a333da526a1063465630ed91c6129c to your computer and use it in GitHub Desktop.
Save Moulick/34a333da526a1063465630ed91c6129c to your computer and use it in GitHub Desktop.
Script for making aws-sso-cli work in Github CodeSpaces
#!/usr/bin/env bash
# This script was introduced to make aws-sso-cli compatible with GitHub Codespaces.
# GitHub Codespaces defines a $BROWSER env var that handles opening urls.
# https://github.com/synfinatic/aws-sso-cli/issues/816
# If $BROWSER is not set then use 'open' on macos and 'xdg-open' on linux.
if [[ -z ${BROWSER+x} ]]; then
if [[ "$(uname)" == "Darwin" ]]; then
BROWSER=open
elif [[ "$(uname)" == "Linux" ]]; then
BROWSER=xdg-open
fi
fi
$BROWSER "$@"
UrlAction: exec
UrlExecCommand:
- ~/.aws-sso/browser-selector.sh
- "%s"
ConfigProfilesUrlAction: exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment