diff options
author | cyBerta <cyberta@riseup.net> | 2019-10-06 17:11:43 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-10-06 17:11:43 +0200 |
commit | 70d08db8f17279ac7a370b2255c51aefc3995d54 (patch) | |
tree | d57fac738211b8b43f3ec2d0998c43bff000f1c6 /go/install_go.sh | |
parent | e2b3fc49cfc84d97080ac406026442ea3115f7d1 (diff) |
create an empty golang folder if it not exists during golang installation
Diffstat (limited to 'go/install_go.sh')
-rwxr-xr-x | go/install_go.sh | 9 |
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 |