]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/01_zprofile/01_zprofile.zshrc
01_zprofile.zshrc: Don't forget the "ax-io" stage!
[ax-zsh.git] / core / 01_zprofile / 01_zprofile.zshrc
index 93a423d43e19b925460599d73cf115bf1c160be1..4ad618ae7d37c059771d525be5b9a49210639bb4 100644 (file)
@@ -3,36 +3,18 @@
 
 [[ -z "$AXZSH_ZPROFILE_READ" ]] || return
 
-# No "zprofile" files have been read in already! So most probably this
-# ZSH instance hasn't been called from an ax-zsh enabled ZSH!
+# No "ax-io" and "zprofile" files have been read in already, looks like this is
+# a non-login shell instance and not a (direct) child of a AX-ZSH enabled login
+# shell! So we have to make sure everything is set up properly by reading in
+# the "ax-io" and "zprofile" stages first!
+
+[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zsh:"
 
 # Reset some environment variables, that could contain "garbage" ...
 unset PS1
 
-[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zsh:"
-
-if [[ -r "$AXZSH/cache/zprofile.cache" ]]; then
-       # Cache file exists, use it!
-       [[ -n "$AXZSH_DEBUG" ]] \
-               && echo "   - Reading cache file \"$AXZSH/cache/zprofile.cache\" ..."
-       source "$AXZSH/cache/zprofile.cache"
-else
-       # No cache file, so read plugins manually. The "plugin_list" can be
-       # empty, when the "zshrc" stage has been read in using the cache file,
-       # but there is no cache file for the "zprofile" stage. In that case
-       # the "plugin_list" must be assembled right now (see "ax.zsh" file!):
-       if [[ -z "$plugin_list" ]]; then
-               typeset -U plugin_list
-               plugin_list=(
-                       "$AXZSH/core/"[0-5]*
-                       "$AXZSH/active_plugins/"*(N)
-                       "$AXZSH/core/"[6-9]*
-               )
-       fi
-       for plugin ($plugin_list); do
-               axzsh_load_plugin "$plugin" "zprofile"
-       done
-fi
+axzsh_handle_stage "01_zprofile.zsh" "ax-io"
+axzsh_handle_stage "01_zprofile.zsh" "zprofile"
 AXZSH_ZPROFILE_READ=2
 
 [[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zsh (end)"