-
-
Save dwchiang/10849350 to your computer and use it in GitHub Desktop.
# 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 |
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 |
This works!! thanks for that! 👏
Btw for those encountering this issue that contains this message: Ignore insecure directories and continue
This can help https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories
Thanks very much - fixed a super annoying issue.
Also see
brew cask info
that tell to source those files in the zshrc.➜ brew cask info google-cloud-sdk google-cloud-sdk: latest https://cloud.google.com/sdk/ /usr/local/Caskroom/google-cloud-sdk/latest (15,579 files, 201.8MB) From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/google-cloud-sdk.rb ==> Name Google Cloud SDK ==> Artifacts google-cloud-sdk/install.sh (Installer) google-cloud-sdk/bin/bq (Binary) google-cloud-sdk/bin/gcloud (Binary) google-cloud-sdk/bin/git-credential-gcloud.sh -> git-credential-gcloud (Binary) google-cloud-sdk/bin/gsutil (Binary) ==> Caveats google-cloud-sdk is installed at /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk. Add your profile: for bash users source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc' source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc' for zsh users source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc' source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'
Fantastic, thanks a lot for your help.
Just a quick note that I had to use brew info google-cloud-sdk
and not brew cask info google-cloud-sdk
with Homebrew's version 3.2.11 as the cask
command seems now deprecated.
Adding
gcloud
to the plugin list in~/.zshrc
did the trick for me
On a Mac and this was the simple solution for me after a brew install google-cloud-sdk
Adding
gcloud
to the plugin list in~/.zshrc
did the trick for me
This worked for me in March 2022, probably the easiest solution on macOS
@louicoder i'm assuming that when you, and others, are referring to "adding gcloud
to the plugin list` you are using oh-my-zsh and this is the oh-my-zshell plugin list and corresponding plugin?
Adding
gcloud
to the plugin list in~/.zshrc
did the trick for me
Can confirm this helps.
Update: I reinstalled zsh on my machine and that took care of the issue.