Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GCP project in prompt #292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

sebneira
Copy link

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
Copy link
Author

sebneira commented Oct 2, 2018

Any news on this PR?

@alvis
Copy link

alvis commented Oct 22, 2018

@niechen: +1 for this PR

@sebneira
Copy link
Author

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

@maoueh
Copy link

maoueh commented Aug 21, 2020

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
Copy link
Author

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

@sebneira
Copy link
Author

Any chance to get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants