formatted gcloud completion and used helper function
parent
15461c4ca5
commit
6ccb6c8eef
|
|
@ -1,9 +1,13 @@
|
||||||
#/usr/bin/env bash
|
#/usr/bin/env bash
|
||||||
# Bash completion for Google Cloud SDK
|
# Bash completion for Google Cloud SDK
|
||||||
|
|
||||||
if which gcloud >/dev/null 2>&1; then
|
if _command_exists gcloud
|
||||||
GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")}
|
then
|
||||||
for i in $(ls ${GOOGLE_SDK_ROOT}/*.bash.inc); do
|
# get install path
|
||||||
source $i
|
GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")}
|
||||||
done
|
|
||||||
|
# souce all the bash completion file that are available
|
||||||
|
for i in $(ls ${GOOGLE_SDK_ROOT}/*.bash.inc); do
|
||||||
|
source $i
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue