Only migrate histfile if target doesn't exist

This commit is contained in:
Kenneth Benzie 2024-09-11 19:49:03 +01:00
parent 8812ef8544
commit ee2dac70db

2
zshenv
View File

@ -16,7 +16,7 @@ HISTSIZE=20000
SAVEHIST=20000 SAVEHIST=20000
# Migrate histfile from cache to state directory # Migrate histfile from cache to state directory
[ -f $HOME/.cache/zsh/histfile ] && \ ! [ -f $HISTFILE ] && [ -f $HOME/.cache/zsh/histfile ] && \
mv $HOME/.cache/zsh/histfile \ mv $HOME/.cache/zsh/histfile \
${XDG_STATE_HOME:-$HOME/.local/state}/zsh/histfile ${XDG_STATE_HOME:-$HOME/.local/state}/zsh/histfile