projects
/
webi-installers
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fcd3ad4
)
improve output when re-installing or switching go versions
author
AJ ONeal
<coolaj86@gmail.com>
Sat, 13 Jun 2020 20:25:11 +0000
(14:25 -0600)
committer
AJ ONeal
<coolaj86@gmail.com>
Sat, 13 Jun 2020 20:25:17 +0000
(14:25 -0600)
golang/install.bash
patch
|
blob
|
history
diff --git
a/golang/install.bash
b/golang/install.bash
index d31304466886c8159807e9bf1f1d6a10a1d2f97a..d1fb672ba036f6d11932a93a7cefc5a4309c22ec 100644
(file)
--- a/
golang/install.bash
+++ b/
golang/install.bash
@@
-59,6
+59,7
@@
update_go_home() {
if [ -x "$new_go_home/bin/go" ]; then
update_go_home
if [ -x "$new_go_home/bin/go" ]; then
update_go_home
+ echo "switched to go${WEBI_VERSION} at $new_go_home"
exit 0
fi
exit 0
fi
@@
-66,13
+67,16
@@
fi
set +e
cur_go="$(command -v go)"
set -e
set +e
cur_go="$(command -v go)"
set -e
+cur_go_version=""
if [ -n "$cur_go" ]; then
if [ -n "$cur_go" ]; then
- cur_ver=$(go version | cut -d' ' -f3 | sed 's:go::')
- if [ "$cur_ver" == "$(echo $WEBI_VERSION | sed 's:\.0::g')" ]; then
+ cur_go_version=$(go version | cut -d' ' -f3 | sed 's:go::')
+fi
+if [ -n "$cur_go" ]; then
+ if [ "$cur_go_version" == "$(echo $WEBI_VERSION | sed 's:\.0::g')" ]; then
echo "go v$WEBI_VERSION already installed at $cur_go"
exit 0
elif [ "$cur_go" != "$new_go" ]; then
echo "go v$WEBI_VERSION already installed at $cur_go"
exit 0
elif [ "$cur_go" != "$new_go" ]; then
- echo "WARN: possible conflict
with go v$WEBI_VERSION at $cur_go
"
+ echo "WARN: possible conflict
between go${WEBI_VERSION} and go${cur_go_version} at ${cur_go}
"
fi
fi
fi
fi