File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ CURL_CMD=$( which curl)
4
+ YUM_CMD=$( which yum)
5
+ DNF_CMD=$( which dnf)
6
+ APT_GET_CMD=$( which apt-get)
7
+ PACMAN_CMD=$( which pacman)
8
+ APK_CMD=$( which apk)
9
+ GIT_CMD=$( which git)
10
+ SUDO_CMD=$( which sudo)
11
+
12
+ USER=" $( id -un 2> /dev/null || true) "
13
+ SUDO=' '
14
+ if [ " $USER " != ' root' ]; then
15
+ if [ ! -z $SUDO_CMD ]; then
16
+ SUDO=' sudo'
17
+ else
18
+ cat >&2 << -'EOF '
19
+ Error: this installer needs the ability to run commands as root.
20
+ We are unable to find "sudo". Make sure its available to make this happen
21
+ EOF
22
+ exit 1
23
+ fi
24
+ fi
25
+
26
+ RESET=' [0m'
27
+ RED=' [0;31m'
28
+ GREEN=' [0;32m'
29
+ YELLOW=' [0;33m'
30
+ log () {
31
+ echo " [` date " +%Y.%m.%d-%H:%M:%S%Z" ` ]$1 $2 "
32
+ }
33
+ info () {
34
+ log " $GREEN INFO$RESET $1 "
35
+ }
36
+ warn () {
37
+ log " $YELLOW WARN$RESET $1 "
38
+ }
39
+ error () {
40
+ log " $RED ERROR$RESET $1 "
41
+ }
42
+
43
+ if [ ! -z $CURL_CMD ]; then
44
+ curl https://sdk.cloud.google.com | bash
45
+
46
+ else
47
+ echo " Couldn't install package"
48
+ exit 1;
49
+ fi
Original file line number Diff line number Diff line change
1
+ name = " gCloud"
2
+ shortname = " gcloud"
3
+ description = " CLI tool of GCP"
4
+
5
+ [curl ]
6
+ sh = """
7
+ curl https://sdk.cloud.google.com | bash
8
+ """
You can’t perform that action at this time.
0 commit comments