From 4bc36648f38d81d4335d63faa53766ecc5160ce4 Mon Sep 17 00:00:00 2001 From: Preston Hunt Date: Fri, 28 Aug 2026 12:22:52 -0700 Subject: [PATCH] zsh: test ~/.zshenv with -f, not -d ~/.zshenv is a file, so '-d' was never true and that half of the guard was dead -- the intent was clearly to avoid clobbering a zsh setup the user already has. The function then overwrites ~/.zshenv with a heredoc, so the check matters. In practice the '-d $ZPREZTODIR' half already short-circuited repeat runs; this makes the script also leave a pre-existing ~/.zshenv alone on a machine that has one but no prezto checkout. Co-Authored-By: Claude Opus 5 (1M context) --- setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup b/setup index df939ed..ce1fdc6 100755 --- a/setup +++ b/setup @@ -236,8 +236,8 @@ setup_zsh_with_prezto() { local ZDOTDIR=$XDG_CONFIG_HOME/zsh local ZPREZTODIR=$ZDOTDIR/.zprezto - # prezto - if [[ -d "$HOME/.zshenv" || -d "$ZPREZTODIR" ]]; then + # prezto; bail out rather than clobber an existing zsh setup + if [[ -f "$HOME/.zshenv" || -d "$ZPREZTODIR" ]]; then return fi