1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-08 21:28:24 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
ajilty
dfa88b4d36
feat(gcloud): support macports installation path (#11133)
Closes #11133
2022-09-08 20:33:33 +02:00
James Yeoman
18d2152798
feat(gcloud): support for official apt repo (#10889)
Fixes #10888
Closes #10889
2022-09-08 20:33:23 +02:00

View File

@ -10,8 +10,10 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then
"/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
"/usr/share/google-cloud-sdk"
"/snap/google-cloud-sdk/current"
"/usr/lib64/google-cloud-sdk/"
"/usr/lib/google-cloud-sdk"
"/usr/lib64/google-cloud-sdk"
"/opt/google-cloud-sdk"
"/opt/local/libexec/google-cloud-sdk"
)
for gcloud_sdk_location in $search_locations; do
@ -20,15 +22,28 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then
break
fi
done
unset search_locations gcloud_sdk_location
fi
if (( ${+CLOUDSDK_HOME} )); then
# Only source this if gcloud isn't already on the path
if (( ! $+commands[gcloud] )); then
# Only source this if GCloud isn't already on the path
if [[ -f "${CLOUDSDK_HOME}/path.zsh.inc" ]]; then
source "${CLOUDSDK_HOME}/path.zsh.inc"
fi
fi
source "${CLOUDSDK_HOME}/completion.zsh.inc"
# Look for completion file in different paths
for comp_file (
"${CLOUDSDK_HOME}/completion.zsh.inc" # default location
"/usr/share/google-cloud-sdk/completion.zsh.inc" # apt-based location
); do
if [[ -f "${comp_file}" ]]; then
source "${comp_file}"
break
fi
done
unset comp_file
export CLOUDSDK_HOME
fi