bug fixes
authorAJ ONeal <aj@therootcompany.com>
Mon, 4 May 2020 11:30:42 +0000 (11:30 +0000)
committerAJ ONeal <aj@therootcompany.com>
Mon, 4 May 2020 11:30:42 +0000 (11:30 +0000)
node/node.bash
serviceman/serviceman.bash
webi/template.bash

index 0d2a91715a2b35e898962ffd177bc7c695bd933d..e4a2ef75c5512189c8b9168b52b1dcdc9b133c24 100644 (file)
@@ -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
 
index 13d3b3c407ebd9a86f9944053d4398d254ec385a..df808776fbc50bf4073cc5e7e2d92771c8105142 100644 (file)
 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?
index b95c0501e2be6478cf75a692691f8f6198212748..2af0e7e033ed9a571ebd20acd7a4a75275723f12 100644 (file)
@@ -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