Created
April 16, 2014 10:30
-
-
Save dwchiang/10849350 to your computer and use it in GitHub Desktop.
gcloud with zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The next line updates PATH for the Google Cloud SDK. | |
| source /Users/dwchiang/google-cloud-sdk/path.zsh.inc | |
| # The next line enables zsh completion for gcloud. | |
| source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| script_link="$( readlink "$0" )" || script_link="$0" | |
| apparent_sdk_dir="${script_link%/*}" | |
| if [ "$apparent_sdk_dir" == "$script_link" ]; then | |
| apparent_sdk_dir=. | |
| fi | |
| sdk_dir="$( cd -P "$apparent_sdk_dir" && pwd -P )" | |
| bin_path="$sdk_dir/bin" | |
| export PATH=$bin_path:$PATH |
Adding
gcloudto the plugin list in~/.zshrcdid the trick for me
Can confirm this helps.
For those who installed gcloud with yay and prefer adding a source command manually . /opt/google-cloud-cli/completion.zsh.inc, but yeah, generally, adding gcloud as a plugin is the right way to achieve this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@louicoder i'm assuming that when you, and others, are referring to "adding
gcloudto the plugin list` you are using oh-my-zsh and this is the oh-my-zshell plugin list and corresponding plugin?