projects
/
webi-installers
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f17655d
)
improve output when re-installing or switching go versions
author
AJ ONeal
<coolaj86@gmail.com>
Sat, 13 Jun 2020 20:32:15 +0000
(14:32 -0600)
committer
AJ ONeal
<coolaj86@gmail.com>
Sat, 13 Jun 2020 20:32:15 +0000
(14:32 -0600)
golang/install.bash
patch
|
blob
|
history
diff --git
a/golang/install.bash
b/golang/install.bash
index d1fb672ba036f6d11932a93a7cefc5a4309c22ec..138f2330167e4347ab5f481052e491a5894493a7 100644
(file)
--- a/
golang/install.bash
+++ b/
golang/install.bash
@@
-57,12
+57,6
@@
update_go_home() {
webi_path_add "$common_go_bin/bin"
}
webi_path_add "$common_go_bin/bin"
}
-if [ -x "$new_go_home/bin/go" ]; then
- update_go_home
- echo "switched to go${WEBI_VERSION} at $new_go_home"
- exit 0
-fi
-
# Test for existing version
set +e
cur_go="$(command -v go)"
# Test for existing version
set +e
cur_go="$(command -v go)"
@@
-75,8
+69,15
@@
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
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 "WARN: possible conflict between go${WEBI_VERSION} and go${cur_go_version} at ${cur_go}"
+ else
+ if [ "$cur_go" != "$common_go_home/bin/go" ] && [ "$cur_go" != "$new_go" ]; then
+ echo "WARN: possible conflict between go${WEBI_VERSION} and go${cur_go_version} at ${cur_go}"
+ fi
+ if [ -x "$new_go_home/bin/go" ]; then
+ update_go_home
+ echo "switched to go${WEBI_VERSION} at $new_go_home"
+ exit 0
+ fi
fi
fi
fi
fi