replace AWS_SESSION_EXPIRATION

aws-vault 7.X removed  AWS_SESSION_EXPIRATION env and replaced with AWS_CREDENTIAL_EXPIRATION
to make this theme work for aws-vault 7.X, we must replace this env.

see: https://github.com/99designs/aws-vault/pull/1143
pull/341/head
iyenigul 1 year ago committed by GitHub
parent 76cac81206
commit 2ddb5051b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -660,13 +660,13 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
[ "$theme_display_aws_vault_profile" = 'yes' ]
or return
[ -n "$AWS_VAULT" -a -n "$AWS_SESSION_EXPIRATION" ]
[ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" ]
or return
set -l profile $AWS_VAULT
set -l now (date --utc +%s)
set -l expiry (date -d "$AWS_SESSION_EXPIRATION" +%s)
set -l expiry (date -d "$AWS_CREDENTIAL_EXPIRATION" +%s)
set -l diff_mins (math "floor(( $expiry - $now ) / 60)")
set -l diff_time $diff_mins"m"

Loading…
Cancel
Save