mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
add check for macos in aws-vault
use gdate instead of date due to difference in syntax
This commit is contained in:
parent
7d8e6274c7
commit
703674353d
@ -662,10 +662,15 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|||||||
[ -n "$AWS_VAULT" -a -n "$AWS_SESSION_EXPIRATION" ]
|
[ -n "$AWS_VAULT" -a -n "$AWS_SESSION_EXPIRATION" ]
|
||||||
or return
|
or return
|
||||||
|
|
||||||
set -l profile $AWS_VAULT
|
if test (uname) = Darwin
|
||||||
|
set now (gdate --utc +%s)
|
||||||
|
set expiry (gdate -d "$AWS_SESSION_EXPIRATION" +%s)
|
||||||
|
else
|
||||||
|
set now (date --utc +%s)
|
||||||
|
set expiry (date -d "$AWS_SESSION_EXPIRATION" +%s)
|
||||||
|
end
|
||||||
|
|
||||||
set -l now (date --utc +%s)
|
set -l profile $AWS_VAULT
|
||||||
set -l expiry (date -d "$AWS_SESSION_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