summaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-05 20:48:21 +0200
committercyBerta <cyberta@riseup.net>2019-10-05 20:48:21 +0200
commit7776fd80c467ccc391bf657404467794b63c709b (patch)
treee70145bb9d8d959d8c6305b8e9cdbc0db36b9edd /go
parentfca6c9dcff1b5b5400a61b7411a7f72460fbfbfa (diff)
improve golang installation script
Diffstat (limited to 'go')
-rwxr-xr-xgo/install_go.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/go/install_go.sh b/go/install_go.sh
index 0181d77c..dad35530 100755
--- a/go/install_go.sh
+++ b/go/install_go.sh
@@ -2,5 +2,16 @@
GO_VERSION=go1.12.7.linux-amd64
-curl -o $GO_VERSION.tar.gz https://dl.google.com/go/$GO_VERSION.tar.gz
+if [[ $(ls -A ${GO_VERSION}.tar.gz) ]]
+then
+ echo "reusing downloaded golang bundle"
+else
+ echo "installing go lang bundle ${GO_VERSION}.tar.gz"
+ curl -o $GO_VERSION.tar.gz https://dl.google.com/go/$GO_VERSION.tar.gz
+fi
+
+if [[ $(ls -A ./golang/*) ]]
+then
+ rm -r ./golang/*
+fi
tar -C ./golang -xzf $GO_VERSION.tar.gz