]> arthur.barton.de Git - ax-zsh.git/blobdiff - ax.zsh
Write an initial PATH variable to the "ax-io" cache file
[ax-zsh.git] / ax.zsh
diff --git a/ax.zsh b/ax.zsh
index edda7093f6fd9e533c8bd4e62d1c9be5041d765e..63ae7493c9ecac22d48633847a05a6c8ff8455af 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -61,11 +61,20 @@ function axzsh_handle_stage {
                )
 
                # Create new cache file:
-               if [[ -n "$cache_file" && -w "$new_cache_file" ]]; then
-                       [[ -n "$AXZSH_DEBUG" ]] \
-                               && echo "   (Writing new cache file to \"$new_cache_file\" ...)"
-                       if ! printf "# %s\n\n" "$(LC_ALL=C date)" >"$new_cache_file"; then
-                               unset new_cache_file
+               [[ -n "$AXZSH_DEBUG" ]] \
+                       && echo "   (Writing new cache file to \"$new_cache_file\" ...)"
+               if ! printf "# %s\n\n" "$(LC_ALL=C date)" >"$new_cache_file"; then
+                       unset new_cache_file
+               else
+                       # New cache file successfully created ...
+                       if [[ "$type" = "ax-io" ]]; then
+                               # AX-IO Stage:
+                               # Write an initial PATH variable to the cache
+                               # file, which becomes overwritten by the path
+                               # plugin at the "zprofile" stage later on, but
+                               # this way "ax-io" stage plugins have a somewhat
+                               # saner PATH to begin with ...
+                               printf 'export PATH="%s"\n\n' "$PATH" >>"$new_cache_file"
                        fi
                fi
 
@@ -224,6 +233,7 @@ fi
 # Check for "debug mode" ...
 if [[ -f "$AXZSH/debug" || -f "$HOME/.axzsh.debug" ]]; then
        export AXZSH_DEBUG=1
+       export POWERLEVEL9K_INSTANT_PROMPT=quiet
        echo "AXZSH=$AXZSH"
        echo "AXZSH_DEBUG=$AXZSH_DEBUG"
        echo "AXZSH_PLUGIN_D=$AXZSH_PLUGIN_D"