summaryrefslogtreecommitdiff
path: root/data/golang/bootstrap.sh
blob: 3cf75814d59cb0c72e1820cf052686f4441a537d (plain)
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
#!/bin/bash
# Bootstraps go to compile go.
set -e

darwin='https://storage.googleapis.com/golang/go1.11.10.darwin-amd64.tar.gz'
linux='https://storage.googleapis.com/golang/go1.11.10.linux-amd64.tar.gz'
url=''

case "$(uname)" in
	Linux)
		url=${linux}
	;;
	Darwin)
		url=${darwin}
	;;
	*)
		echo "$0 - Unknown system."
		exit 1
	;;
esac

cd $(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
wget ${url} >/dev/null
tar xvf ${url##*/} >/dev/null
echo $PWD/go/