-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
install.sh
executable file
·48 lines (43 loc) · 1.07 KB
/
install.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
#!/bin/bash
# FIND: v0.4
TAG=0.3
if [[ "$@" != "" ]]
then
TAG="$@"
fi
abort() {
printf "%s\n" "$@" >&2
exit 1
}
# First check OS.
OS="$(uname)"
if [[ "${OS}" == "Linux" ]]
then
CYBER_LINUX=1
CYBER_PATH=/usr/local/bin
elif [[ "${OS}" == "Darwin" ]]
then
CYBER_MACOS=1
CYBER_PATH=/usr/local/bin
else
abort "Install is only supported on macOS and Linux."
fi
# Required installation paths.
if [[ -n "${CYBER_MACOS}" ]]
then
UNAME_MACHINE="$(/usr/bin/uname -m)"
if [[ "${UNAME_MACHINE}" == "arm64" ]]
then
CYBER_BUNDLE="https://github.com/fubark/cyber/releases/download/${TAG}/cyber-macos-arm64.tar.gz"
else
CYBER_BUNDLE="https://github.com/fubark/cyber/releases/download/${TAG}/cyber-macos-x64.tar.gz"
fi
else
UNAME_MACHINE="$(uname -m)"
CYBER_BUNDLE="https://github.com/fubark/cyber/releases/download/${TAG}/cyber-linux-x64.tar.gz"
fi
sudo sh -c "mkdir -p ${CYBER_PATH}; \
echo 'Downloading ${CYBER_BUNDLE}.'; \
curl -fsSL $CYBER_BUNDLE | tar -xz -C $CYBER_PATH; \
chmod a+x ${CYBER_PATH}/cyber; \
echo 'Installed to ${CYBER_PATH}/cyber.'"