-
Notifications
You must be signed in to change notification settings - Fork 27
/
git.io.sh
executable file
·80 lines (65 loc) · 1.81 KB
/
git.io.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
set -euo pipefail
GOBREW_BIN_DIR=$HOME/.gobrew/bin
# check if env GOBREW_ROOT is set
if [ -n "${GOBREW_ROOT:-}" ]; then
GOBREW_BIN_DIR=$GOBREW_ROOT/.gobrew/bin
fi
mkdir -p "$GOBREW_BIN_DIR"
GOBREW_ARCH_BIN=''
GOBREW_BIN='gobrew'
GOBREW_VERSION=${1:-latest}
THISOS=$(uname -s)
ARCH=$(uname -m)
case $THISOS in
Linux*)
case $ARCH in
arm64)
GOBREW_ARCH_BIN="gobrew-linux-arm64"
;;
aarch64)
GOBREW_ARCH_BIN="gobrew-linux-arm64"
;;
armv6l)
GOBREW_ARCH_BIN="gobrew-linux-arm"
;;
armv7l)
GOBREW_ARCH_BIN="gobrew-linux-arm"
;;
*)
GOBREW_ARCH_BIN="gobrew-linux-amd64"
;;
esac
;;
Darwin*)
case $ARCH in
arm64)
GOBREW_ARCH_BIN="gobrew-darwin-arm64"
;;
*)
GOBREW_ARCH_BIN="gobrew-darwin-amd64"
;;
esac
;;
Windows|MINGW64_NT*)
GOBREW_ARCH_BIN="gobrew-windows-amd64.exe"
GOBREW_BIN="gobrew.exe"
;;
esac
if [ -z "$GOBREW_ARCH_BIN" ]; then
echo "This script is not supported on $THISOS and $ARCH"
exit 1
fi
DOWNLOAD_URL="https://github.com/kevincobain2000/gobrew/releases/download/$GOBREW_VERSION/$GOBREW_ARCH_BIN"
if [ "$GOBREW_VERSION" = "latest" ]; then
DOWNLOAD_URL="https://github.com/kevincobain2000/gobrew/releases/$GOBREW_VERSION/download/$GOBREW_ARCH_BIN"
fi
echo "🥳 Installing gobrew from: $DOWNLOAD_URL"
echo ""
curl -L -f --progress-bar "$DOWNLOAD_URL" -o "$GOBREW_BIN_DIR"/$GOBREW_BIN
chmod +x "$GOBREW_BIN_DIR/$GOBREW_BIN"
echo "🔧 Installed successfully to: $GOBREW_BIN_DIR/$GOBREW_BIN"
echo "🚀 gobrew help"
"$GOBREW_BIN_DIR/$GOBREW_BIN" help
echo "⭐ Star us on Github, please give it a star on GitHub: https://github.com/kevincobain2000/gobrew"
echo