Replies: 4 comments 9 replies
-
Update: Colleague of mine is on 23.6.3 and it still works on that version. |
Beta Was this translation helpful? Give feedback.
-
Yes, but not really. We've disabled expansions like command substitution for a prompt string in Bash/Zsh. Two reasons:
Of course. If the format of your "template": "{{ if .Env.AWS_VAULT }} \uF0C2 {{.Env.AWS_VAULT}} {{ if .Env.AWS_CREDENTIAL_EXPIRATION }} :: {{ .Env.AWS_CREDENTIAL_EXPIRATION | toDate `2006-01-02T15:04:05Z0700` | date `2006-01-02 15:04:05` }} {{ end }} {{ end }}" |
Beta Was this translation helpful? Give feedback.
-
Hi @JanDeDobbeleer , The ENV var is always in the same format so that will work for printing the date. Thanks for the assistance! |
Beta Was this translation helpful? Give feedback.
-
Thank you both for helping! |
Beta Was this translation helpful? Give feedback.
-
Hello,
In a previous version ( unfortunately I don't know which one ) the
template
parsed the string so I could use a bash function inside of it. I used this to show my aws_vault profile and then show me a localized expiry date for the session so I don't start any longer running things on AWS ( like with terraform ) 2 minutes before my session expires.The segment looks like this:
In the past it would look like this:
With the latest version ( I updated monday ) It looks like this:
Did something change that I can no longer run this? Is there a better way to achieve this?
The
get_aws_vault_expiry
just converts the timestamp from UTC to my local time.Beta Was this translation helpful? Give feedback.
All reactions