From 02ab3752425c070a5d2ad49446aa3286b762a278 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 3 Feb 2019 16:36:47 +0100 Subject: [PATCH] axzshctl set-theme: Don't remove theme link first Force creating the symlink, overwriting a possibly already existing one. This prevents us from having no theme link at all, if something goes wrong ;-) --- bin/axzshctl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/axzshctl b/bin/axzshctl index 70c9aff..5915dd4 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -191,14 +191,8 @@ function EnableDefaultPlugins { function SetTheme { local link_name="$AXZSH/active_theme" - if [ $# -ne 1 ]; then - echo "Usage: axzsh_set_theme " - 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 $? } -- 2.39.2