]> arthur.barton.de Git - ax-zsh.git/commitdiff
Try harder to detect location of the AX-ZSH installation
authorAlexander Barton <alex@barton.de>
Fri, 21 Oct 2016 12:36:45 +0000 (14:36 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 21 Oct 2016 12:36:45 +0000 (14:36 +0200)
bin/axzshctl

index 9d5eff027a2dc60f9ae31b75c8a839eaed48de24..b9d20d36a17fde3001c7097f3ea9ccee73b594e1 100755 (executable)
@@ -266,9 +266,12 @@ NAME="$0:t"
 
 [[ $# -gt 0 ]] || Usage
 
-if [[ -z "$AXZSH" || ! -d "$AXZSH" ]]; then
-       ax_msg 2 "Oops, \"AXZSH\" is not set or invalid!"
-       exit 3
+if [[ -z "$AXZSH" || ! -r "$AXZSH/ax.zsh" ]]; then
+       [[ -r "$HOME/.axzsh/ax.zsh" ]] && AXZSH="$HOME/.axzsh"
+       if [[ ! -r "$AXZSH/ax.zsh" ]]; then
+               ax_msg 2 "Oops, \"AXZSH\" is not set or invalid and can't be autodetected!"
+               exit 3
+       fi
 fi
 
 cmd="$1"