]> arthur.barton.de Git - ax-zsh.git/blobdiff - bin/axzshctl
axzshctl set-theme: Don't remove theme link first
[ax-zsh.git] / bin / axzshctl
index 62121d8b0e0a5b3a160cfb7b1bd35719e1aa92ba..5915dd468aa95446e9b033b953d4c1db3a5bac87 100755 (executable)
@@ -10,7 +10,7 @@ for dir ("$HOME/lib" "$HOME/.ax" /usr/local /opt/ax /usr); do
        ax_common="${dir}/lib/ax/ax-common.sh"
        [[ -r "$ax_common" ]] && source "$ax_common"
 done
-if [[ -z "$ax_common_sourced" || axzsh_is_dumb_terminal ]]; then
+if [[ -z "$ax_common_sourced" ]]; then
        function ax_msg {
                shift
                echo "$@"
@@ -191,14 +191,8 @@ function EnableDefaultPlugins {
 function SetTheme {
        local link_name="$AXZSH/active_theme"
 
-       if [ $# -ne 1 ]; then
-               echo "Usage: axzsh_set_theme <name|->"
-               return 1
-       fi
-
-       rm -f "$link_name" || return 1
-
        if [ "$1" = "-" ]; then
+               rm -f "$link_name" || return 1
                echo "Theme settings have been reset."
                return 0
        fi
@@ -228,7 +222,7 @@ function SetTheme {
                        return 1
                fi
        fi
-       ln -sv "$theme" "$link_name" || return 1
+       ln -fsv "$theme" "$link_name" || return 1
        return $?
 }