mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
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
This commit is contained in:
parent
76cac81206
commit
2ddb5051b0
@ -660,13 +660,13 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|||||||
[ "$theme_display_aws_vault_profile" = 'yes' ]
|
[ "$theme_display_aws_vault_profile" = 'yes' ]
|
||||||
or return
|
or return
|
||||||
|
|
||||||
[ -n "$AWS_VAULT" -a -n "$AWS_SESSION_EXPIRATION" ]
|
[ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" ]
|
||||||
or return
|
or return
|
||||||
|
|
||||||
set -l profile $AWS_VAULT
|
set -l profile $AWS_VAULT
|
||||||
|
|
||||||
set -l now (date --utc +%s)
|
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_mins (math "floor(( $expiry - $now ) / 60)")
|
||||||
|
|
||||||
set -l diff_time $diff_mins"m"
|
set -l diff_time $diff_mins"m"
|
||||||
|
Loading…
Reference in New Issue
Block a user