-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall.sh
executable file
·42 lines (36 loc) · 922 Bytes
/
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
#!/bin/sh
version="1.1"
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[1;34m'
DARK='\033[1;30m'
NC='\033[0m'
echo "${BLUE}notion-site binary installer ${version}${NC}"
unameOut="$(uname -s)"
case "${unameOut}" in
Darwin*)
arch=macos-amd64
;;
*)
arch=linux-amd64
;;
esac
bin_dir="/usr/local/bin"
url=$(curl -s https://api.github.com/repos/nonacosa/notion-site/releases/latest | grep "browser_download_url.*${arch}.tar.gz\"" | cut -d : -f 2,3 | tr -d '\"[:space:]')
echo "${DARK}"
echo "Configuration: [${arch}]"
echo "Location: [${url}]"
echo "Directory: [${bin_dir}]"
echo "${NC}"
test ! -d "${bin_dir}" && mkdir "${bin_dir}"
curl -J -L "${url}" | tar xz -C "${bin_dir}"
if [ $? -eq 0 ]; then
echo "${GREEN}"
echo "Installation completed successfully."
echo "$ notion-site version"
"${bin_dir}"/notion-site version
else
echo "${RED}"
echo "Failed installing notion-site"
fi
echo "${NC}"