diff options
author | cyBerta <cyberta@riseup.net> | 2019-10-05 20:48:21 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-10-05 20:48:21 +0200 |
commit | 7776fd80c467ccc391bf657404467794b63c709b (patch) | |
tree | e70145bb9d8d959d8c6305b8e9cdbc0db36b9edd /go/install_go.sh | |
parent | fca6c9dcff1b5b5400a61b7411a7f72460fbfbfa (diff) |
improve golang installation script
Diffstat (limited to 'go/install_go.sh')
-rwxr-xr-x | go/install_go.sh | 13 |
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 |