Skip to content

Commit 089f2cc

Browse files
tools
1 parent 4553d9e commit 089f2cc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tools/gcloud.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Download gcloud to Downloads, extract and then run
2+
# mv ~/Downloads/google-cloud-sdk /usr/local/bin/
3+
# after opening a new shell, run to login:
4+
# gcloud init
5+
6+
# The next line updates PATH for the Google Cloud SDK.
7+
if [ -f '/usr/local/bin/google-cloud-sdk/path.zsh.inc' ]; then . '/usr/local/bin/google-cloud-sdk/path.zsh.inc'; fi
8+
9+
# The next line enables shell command completion for gcloud.
10+
if [ -f '/usr/local/bin/google-cloud-sdk/completion.zsh.inc' ]; then . '/usr/local/bin/google-cloud-sdk/completion.zsh.inc'; fi
11+
12+
gcloudPath=`which gcloud`
13+
function dot_gcloud_version() {
14+
# gcloud version --format=json
15+
if [ -f ${gcloudPath} ]; then
16+
printToolInfo 'gcloud core' $( gcloud version --format="value(core)")
17+
printToolInfo 'gcloud sdk' $(gcloud version --format='value("Google Cloud SDK")')
18+
fi
19+
}
20+
21+
function dot_gcloud_whoami() {
22+
if [ -f ${gcloudPath} ]; then
23+
whoami=$(gcloud config get-value account)
24+
printToolInfo 'gcloud' "$whoami"
25+
fi
26+
}

0 commit comments

Comments
 (0)