-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·39 lines (34 loc) · 955 Bytes
/
configure
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
#!/bin/sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
if [ $? -ne 0 ]; then
echo "Error: couldn't install rust";
fi
# get gcc
# assuming macos users will already have it
if [ "$(uname -s)" = "Linux" ]; then
sudo apt install build-essential
if [ $? -ne 0 ]; then
echo "Error: couldn't install gcc";
fi
fi
mkdir external;
cd external;
if [ ! -d libs ]; then
git clone https://github.com/BrandonMFong/libs;
if [ $? -ne 0 ]; then
echo "Error: couldn't clone libs";
fi
fi
cd ..;
if [ "$(uname -s)" = "Linux" ]; then
goname="go1.20.2.linux-amd64.tar.gz";
curl --location "https://go.dev/dl/$goname" --output "$goname";
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "$goname";
rm -rf "$goname";
elif [ "$(uname -s)" = "Darwin" ]; then
pkgname="out.pkg";
curl --location "https://go.dev/dl/go1.20.2.darwin-amd64.pkg" --output "out.pkg"
sudo installer -pkg "$pkgname" -target / -verbose;
rm -rfv $pkgname;
fi