Fix clean target to remove all symlinks, not just dangling ones

-xtype l only catches broken symlinks; a stale symlink pointing to a
file that still exists (e.g. leftover from stow laptop on a work PC)
would survive clean and then block the next stow run.

Also add .zshrc/.zshenv to the clean sweep.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 10:50:27 -04:00
parent 88c9e165b0
commit d4b7b6354d

View File

@@ -10,5 +10,7 @@ clean:
stow -D shared laptop work 2>/dev/null; \ stow -D shared laptop work 2>/dev/null; \
find $(HOME)/.config/nvim $(HOME)/.config/emacs $(HOME)/.config/tmux \ find $(HOME)/.config/nvim $(HOME)/.config/emacs $(HOME)/.config/tmux \
$(HOME)/.config/ghostty $(HOME)/.config/ranger \ $(HOME)/.config/ghostty $(HOME)/.config/ranger \
-maxdepth 4 -xtype l -delete 2>/dev/null; \ -maxdepth 4 -type l -delete 2>/dev/null; \
find $(HOME) -maxdepth 1 -type l \( -name '.zshrc' -o -name '.zshenv' \) \
-delete 2>/dev/null; \
true true