bugfix / switch installed versions

This commit is contained in:
AJ ONeal
2020-05-05 13:34:42 -06:00
parent ca67ebdfaa
commit b560b7a53d
2 changed files with 31 additions and 5 deletions

View File

@@ -81,9 +81,23 @@ set -u
# Install node #
##################
common_node_home="${HOME}/.local/opt/node"
new_node_home="${HOME}/.local/opt/node-v${WEBI_VERSION}"
new_node="${HOME}/.local/opt/node-v${WEBI_VERSION}/bin/node"
update_node_home() {
rm -rf "$common_node_home"
ln -s "$new_node_home" "$common_node_home"
# TODO get better output from pathman / output the path to add as return to webi bootstrap
webi_path_add "$common_node_home/bin"
}
if [ -x "$new_go_home/bin/go" ]; then
update_node_home
exit 0
fi
# Test for existing version
set +e
cur_node="$(command -v node)"
@@ -130,8 +144,7 @@ popd 2>&1 >/dev/null
# Update PATH #
###################
# TODO get better output from pathman / output the path to add as return to webi bootstrap
webi_path_add "$new_node_home/bin"
update_node_home
echo "Installed 'node' and 'npm'"
echo ""