caiogondim / bullet-train.zsh

:bullettrain_side: An oh-my-zsh shell theme based on the Powerline Vim plugin
MIT License
2.82k stars 382 forks source link

Add GCP project in prompt #292

Open sebneira opened 5 years ago

sebneira commented 5 years ago

Adds the GCP project in prompt (useful when moving between different projects). 2018-09-27-205342_777x52_scrot

Should I add a way to disable this prompt as not everyone might find it useful?

sebneira commented 5 years ago

Any news on this PR?

alvis commented 5 years ago

@niechen: +1 for this PR

sebneira commented 5 years ago

This PR has been open for half a year already. Are there any reviewers still alive?

maoueh commented 3 years ago

Requires slight tweaks to covers usage of CLOUDSDK_ACTIVE_CONFIG_NAME:

  local gcp_profile=""
  if [[ -n "${CLOUDSDK_ACTIVE_CONFIG_NAME}" && -f "$HOME/.config/gcloud/configurations/config_$CLOUDSDK_ACTIVE_CONFIG_NAME" ]]; then
    gcp_profile="$CLOUDSDK_ACTIVE_CONFIG_NAME"
  elif [[ -f "$HOME/.config/gcloud/active_config" ]]; then
    gcp_profile=$(cat $HOME/.config/gcloud/active_config)
  fi

Instead of plain gcp_profile=$(cat $HOME/.config/gcloud/active_config), and changing if [ -f "$HOME/.config/gcloud/active_config" ]; then to if [ -n "${gcp_profile}" ]; then.

And indeed, there wasn't any review/merge on this repository for a long time :(

sebneira commented 2 years ago

@maoueh updated the PR with the changes you suggested. 2 years later, but better than never!

sebneira commented 1 year ago

Any chance to get this merged?