home-config/fish/functions/_tide_item_aws.fish
0f472179ea1aaab0ab68a109c34fd78b25642422
· 567 B · 11 lines
raw
| 1 | function _tide_item_aws |
| 2 | # AWS_PROFILE overrides AWS_DEFAULT_PROFILE, AWS_REGION overrides AWS_DEFAULT_REGION |
| 3 | set -q AWS_PROFILE && set -l AWS_DEFAULT_PROFILE $AWS_PROFILE |
| 4 | set -q AWS_REGION && set -l AWS_DEFAULT_REGION $AWS_REGION |
| 5 | |
| 6 | if test -n "$AWS_DEFAULT_PROFILE" && test -n "$AWS_DEFAULT_REGION" |
| 7 | _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE/$AWS_DEFAULT_REGION" |
| 8 | else if test -n "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION" |
| 9 | _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION" |
| 10 | end |
| 11 | end |