summaryrefslogtreecommitdiff
path: root/data/golang/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'data/golang/bootstrap.sh')
-rwxr-xr-xdata/golang/bootstrap.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/data/golang/bootstrap.sh b/data/golang/bootstrap.sh
new file mode 100755
index 000000000..3cf75814d
--- /dev/null
+++ b/data/golang/bootstrap.sh
@@ -0,0 +1,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/