home-config/fish/functions/_tide_item_gcloud.fish

ce1c24e3100d48c9c210eb1ebc5ebadcc6b77659 · 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