Commit 7c412e20d835
Changed files (2)
dots
config
zsh
tools
dots/config/zsh/tools/direnv.zsh
@@ -2,9 +2,11 @@
has direnv || return
local cache=${XDG_CACHE_HOME:-$HOME/.cache}/zsh/direnv-init.zsh
-local bin=${commands[direnv]}
+local bin=$(realpath ${commands[direnv]})
-if [[ ! -f $cache || $bin -nt $cache ]]; then
+# Regenerate if cache is missing, binary is newer, or the resolved
+# path changed (e.g. nix store path updated without timestamp change)
+if [[ ! -f $cache || $bin -nt $cache ]] || ! grep -qF "$bin" "$cache" 2>/dev/null; then
mkdir -p ${cache:h}
direnv hook zsh > "$cache"
_zsh_compile_if_needed "$cache"
dots/config/zsh/tools/fzf.zsh
@@ -3,9 +3,11 @@ has fzf || return
[[ $options[zle] = on ]] || return
local cache=${XDG_CACHE_HOME:-$HOME/.cache}/zsh/fzf-init.zsh
-local bin=${commands[fzf]}
+local bin=$(realpath ${commands[fzf]})
-if [[ ! -f $cache || $bin -nt $cache ]]; then
+# Regenerate if cache is missing, binary is newer, or the resolved
+# path changed (e.g. nix store path updated without timestamp change)
+if [[ ! -f $cache || $bin -nt $cache ]] || ! grep -qF "$bin" "$cache" 2>/dev/null; then
mkdir -p ${cache:h}
fzf --zsh > "$cache"
_zsh_compile_if_needed "$cache"