]> arthur.barton.de Git - ax-zsh.git/commitdiff
Clean up external repositories on "axzshctl reset-plugins"
authorAlexander Barton <alex@barton.de>
Fri, 6 May 2016 16:46:45 +0000 (18:46 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 6 May 2016 16:46:45 +0000 (18:46 +0200)
bin/axzshctl

index a17a9dfd26f040bb68de24cd7a5217874c410361..0c2fb0090c2f5bb2d9aab9fff74d59002ea31224 100755 (executable)
@@ -114,12 +114,17 @@ function DisablePlugin {
 
 function ResetPlugins {
        local dir="$AXZSH/active_plugins"
+       local r1=0, r2=0
 
        if [[ -e "$dir" ]]; then
                ax_msg - "Removing all symbolic links in $dir ..."
-               find "$dir" -type l -print -delete
+               find "$dir" -type l -print -delete; r1=$?
        fi
-       return $?
+
+       ax_msg - "Removing all external repositories in \"$AXZSH/repos\" ..."
+       rm -fr "$AXZSH/repos"; r2=$?
+
+       [[ $r1 == 0 && $r2 == 0 ]] && return 0 || return 1
 }
 
 function EnableDefaultPlugins {