-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-dev-tools
executable file
·53 lines (49 loc) · 1.42 KB
/
install-dev-tools
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
#! /bin/bash -x
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "installing..."
elif [[ "$OSTYPE" == "linux-gnueabihf" ]]; then
echo "installing..."
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "unsupported OS"
exit
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "unsupported OS"
exit
elif [[ "$OSTYPE" == "msys" ]]; then
echo "unsupported OS"
exit
elif [[ "$OSTYPE" == "win32" ]]; then
echo "unsupported OS"
exit
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "unsupported OS"
exit
else
echo "unsupported OS"
exit
fi
# install critial tools
sudo apt update
sudo apt install -y expect jq curl git
# install go
ARCH="$(dpkg --print-architecture)"
echo "Downloading $ARCH"
if [[ "$ARCH" == "arm64" ]]; then
GOLOC="https://go.dev/dl/go1.23.1.linux-arm64.tar.gz"
TGOLOC="https://github.com/tinygo-org/tinygo/releases/download/v0.33.0/tinygo_0.33.0_armhf.deb"
elif [[ "$ARCH" == "amd64" ]]; then
GOLOC="https://go.dev/dl/go1.23.1.darwin-amd64.pkg"
TGOLOC="https://github.com/tinygo-org/tinygo/releases/download/v0.33.0/tinygo_0.33.0_amd64.deb"
fi
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go
wget $TGOLOC
sudo dpkg -i ./tinygo*deb
rm tinygo*deb
sudo apt install libstdc++6:armhf
wget $GOLOC
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go*tar.gz
go version
rm go*gz
sudo apt install -y protobuf-compiler
sudo apt install -y protoc-gen-go protoc-gen-go