home-config/fish/functions/_tide_item_gcloud.fish
b469379f9a9f13686516f35369e532fe4975dacf
· 444 B · 8 lines
raw
| 1 | function _tide_item_gcloud |
| 2 | set -q CLOUDSDK_CONFIG || set -l CLOUDSDK_CONFIG ~/.config/gcloud |
| 3 | path is $CLOUDSDK_CONFIG/active_config && |
| 4 | read -l config <$CLOUDSDK_CONFIG/active_config && |
| 5 | path is $CLOUDSDK_CONFIG/configurations/config_$config && |
| 6 | string match -qr '^\s*project\s*=\s*(?<project>.*)' <$CLOUDSDK_CONFIG/configurations/config_$config && |
| 7 | _tide_print_item gcloud $tide_gcloud_icon' ' $project |
| 8 | end |