]> arthur.barton.de Git - ax-zsh.git/blobdiff - install.sh
install.sh: Check if zsh(1) is available
[ax-zsh.git] / install.sh
index 274fa774aadf36f019b2b5e751d9e2c90cdf8dff..0c50964d91ea1a282f7bf4a04bef0392da45d50d 100755 (executable)
@@ -13,7 +13,7 @@ done
 if [ -z "$ax_common_sourced" ]; then
        ax_msg() {
                shift
-               echo "1" "$@"
+               echo "$@"
        }
 fi
 unset dir ax_common ax_common_sourced
@@ -43,7 +43,14 @@ done
 
 if [ ! -d "$AXZSH/active_plugins" ]; then
        ax_msg - "Initializing plugin directory \"$AXZSH/active_plugins\" ..."
-       zsh "$AXZSH/bin/axzshctl" reset-plugins
+       type zsh >/dev/null 2>&1
+       if [ $? -eq 0 ]; then
+               zsh "$AXZSH/bin/axzshctl" reset-plugins
+               exit $?
+       else
+               ax_msg 2 "Oops, \"zsh\" not found!?"
+               exit 1
+       fi
 else
        ax_msg - "Plugin directory \"$AXZSH/active_plugins\" already exists. Ok."
 fi