home-config/fish/functions/_tide_item_gcloud.fish

01132663060e0ace2badde34ba25a216b22db15d · 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