From 3c08ddc94be85d5dae0d4c40614812ee307eb545 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 4 May 2020 11:30:42 +0000 Subject: [PATCH] bug fixes --- node/node.bash | 2 +- serviceman/serviceman.bash | 17 ++++++----------- webi/template.bash | 4 ++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/node/node.bash b/node/node.bash index 0d2a917..e4a2ef7 100644 --- a/node/node.bash +++ b/node/node.bash @@ -69,7 +69,7 @@ if [ -e "$new_node_home/bin/node" ]; then exit 0 fi fi -if [ "$cur_node" != "$new_node" ]; then +if [ -n "$cur_node" ] && [ "$cur_node" != "$new_node" ]; then echo "WARN: possible conflict with node v$WEBI_VERSION at $cur_node" fi diff --git a/serviceman/serviceman.bash b/serviceman/serviceman.bash index 13d3b3c..df80877 100644 --- a/serviceman/serviceman.bash +++ b/serviceman/serviceman.bash @@ -32,16 +32,6 @@ set -e set -u -# Get arch envs, etc -my_url="https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" -curl -fsSL "$my_url" -o serviceman -echo "" -# Make executable -chmod +x ./serviceman -# Move to ~/.local/bin -mkdir -p ~/.local/bin -mv ./serviceman ~/.local/bin - # Test if in PATH set +e my_serviceman=$(command -v serviceman) @@ -54,6 +44,11 @@ if [ -n "$my_serviceman" ]; then fi fi +# Get arch envs, etc +webi_download "https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" "$HOME/Downloads/serviceman" +chmod +x "$HOME/Downloads/serviceman" +mv "$HOME/Downloads/serviceman" "$HOME/.local/bin/" + # add to ~/.local/bin to PATH, just in case -pathman add ~/.local/bin # > /dev/null 2> /dev/null +webi_path_add $HOME/.local/bin # > /dev/null 2> /dev/null # TODO inform user to add to path, apart from pathman? diff --git a/webi/template.bash b/webi/template.bash index b95c050..2af0e7e 100644 --- a/webi/template.bash +++ b/webi/template.bash @@ -45,6 +45,10 @@ webi_download() { if [ -n "${1:-}" ]; then my_url="$1" else + if [ "error" == "$WEBI_CHANNEL" ]; then + echo "Could not find $WEBI_NAME v$WEBI_VERSION" + exit 1 + fi my_url="$WEBI_PKG_URL" echo "Downloading $WEBI_NAME v$WEBI_VERSION" fi -- 2.25.1