From 1b37a85bfc0b46a4694919eb340a8378859e06d3 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 1 Feb 2022 21:19:29 +0100 Subject: [PATCH 1/1] Write an initial PATH variable to the "ax-io" cache file This initial PATH 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 ... --- ax.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ax.zsh b/ax.zsh index 3d693da..63ae749 100644 --- a/ax.zsh +++ b/ax.zsh @@ -65,6 +65,17 @@ function axzsh_handle_stage { && 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 # Read in all the plugins for the current "type": -- 2.39.2