]> arthur.barton.de Git - ax-zsh.git/commitdiff
install.sh: Make it safe to call it wgen ~/.axzsh is a symlink
authorAlexander Barton <alex@barton.de>
Tue, 5 Feb 2019 19:28:27 +0000 (20:28 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 5 Feb 2019 19:28:27 +0000 (20:28 +0100)
install.sh

index e5ded0bfa2c4824060a419203f9a4b635060b2f7..cf290b464a463f0e1b462ff16c170bccad801504 100755 (executable)
@@ -38,12 +38,10 @@ export AXZSH
 
 S=$(dirname "$0")
 
-if [ "$S" = "$AXZSH" -o "$PWD" = "$AXZSH" ]; then
+if [ "$S" = "$AXZSH" ] || [ "$PWD" = "$AXZSH" ] || [ -L "$AXZSH" ]; then
        ax_msg 1 "Initializing \"$AXZSH\":"
 else
        ax_msg 1 "Install AX-ZSH into \"$AXZSH\":"
-
-       [ -L "$AXZSH" ] && rm -f "$AXZSH"
        mkdir -p "$AXZSH" || abort
 
        ax_msg - "Copying binaries and scripts ..."