-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>
17 lines
418 B
Makefile
17 lines
418 B
Makefile
.PHONY: laptop work clean
|
|
|
|
laptop:
|
|
stow shared laptop
|
|
|
|
work:
|
|
stow shared work
|
|
|
|
clean:
|
|
stow -D shared laptop work 2>/dev/null; \
|
|
find $(HOME)/.config/nvim $(HOME)/.config/emacs $(HOME)/.config/tmux \
|
|
$(HOME)/.config/ghostty $(HOME)/.config/ranger \
|
|
-maxdepth 4 -type l -delete 2>/dev/null; \
|
|
find $(HOME) -maxdepth 1 -type l \( -name '.zshrc' -o -name '.zshenv' \) \
|
|
-delete 2>/dev/null; \
|
|
true
|