Skip to content

Commit

Permalink
Move aws-sso login message
Browse files Browse the repository at this point in the history
* The aws-sso login is ran in the main dalmatian script. If it's the
  parent script, it runs without `QUIET_MODE`. To make the message make
  more sense, have it always display the attemping login message.
  Without this move, it can just output: "You're already logged in"
  • Loading branch information
Stretch96 committed Sep 27, 2024
1 parent 6e01be4 commit dcd1bd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/aws-sso/v2/login
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ done
START_URL="$(aws configure get sso_start_url --profile dalmatian-login)"
AWS_SSO_CACHE_JSON="$(grep -h -e "\"$START_URL\"" ~/.aws/sso/cache/*.json || true)"
EXPIRES_AT="$(echo "$AWS_SSO_CACHE_JSON" | jq -r '.expiresAt')"
log_info -l "Attempting AWS SSO login ..." -q "$QUIET_MODE"
if [ -n "$EXPIRES_AT" ]
then
EXPIRES_AT_SEC="$(gdate -d "$EXPIRES_AT" +%s)"
Expand All @@ -44,7 +45,6 @@ if [[
"$FORCE_RELOG" == "1"
]]
then
log_info -l "Attempting AWS SSO login ..." -q "$QUIET_MODE"
aws sso login --profile "$AWS_SSO_PROFILE"
log_info -l "Checking AWS SSO login was successful..." -q "$QUIET_MODE"
AWS_SSO_CACHE_JSON="$(grep -h -e "\"$START_URL\"" ~/.aws/sso/cache/*.json || true)"
Expand Down

0 comments on commit dcd1bd7

Please sign in to comment.