]> arthur.barton.de Git - ax-zsh.git/commitdiff
Make sure that $SHELL is set and available
authorAlexander Barton <alex@barton.de>
Tue, 15 Nov 2016 13:32:42 +0000 (14:32 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 15 Nov 2016 13:32:42 +0000 (14:32 +0100)
And make sure that the path in which zsh(1) itself resides is included
in the search path ($PATH). This can become relevant on Cygwin for
example ...

ax.zsh

diff --git a/ax.zsh b/ax.zsh
index 88c16bd79bcbf9853b3a13f2a3d3e1cbd396c7bf..951257f978810be5a823f420dc40154c0e494e60 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -68,6 +68,14 @@ function axzsh_load_plugin {
        return 0
 }
 
+# Make sure that "my" (=ZSH) directory is in the search path ...
+_p="${0:h}"
+[[ "$_p" != "." ]] && PATH="${0:h}:$PATH"
+unset _p
+
+# Make sure that "SHELL" variable is set and exported
+[[ -n "$SHELL" ]] || export SHELL=$(command -v zsh)
+
 # Make sure that "AXZSH" variable is set and exported
 if [[ -z "$AXZSH" ]]; then
        export AXZSH="$HOME/.axzsh"