summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-06 17:11:43 +0200
committercyBerta <cyberta@riseup.net>2019-10-06 17:11:43 +0200
commit70d08db8f17279ac7a370b2255c51aefc3995d54 (patch)
treed57fac738211b8b43f3ec2d0998c43bff000f1c6
parente2b3fc49cfc84d97080ac406026442ea3115f7d1 (diff)
create an empty golang folder if it not exists during golang installation
-rwxr-xr-xgo/install_go.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/go/install_go.sh b/go/install_go.sh
index dad35530..79264b7e 100755
--- a/go/install_go.sh
+++ b/go/install_go.sh
@@ -10,8 +10,13 @@ else
curl -o $GO_VERSION.tar.gz https://dl.google.com/go/$GO_VERSION.tar.gz
fi
-if [[ $(ls -A ./golang/*) ]]
+if [[ -d ./golang ]]
then
- rm -r ./golang/*
+ if [[ $(ls -A ./golang/*) ]]
+ then
+ rm -r ./golang/*
+ fi
+else
+ mkdir ./golang
fi
tar -C ./golang -xzf $GO_VERSION.tar.gz