Skip to content

fix(justfile): skip real dirs in _common-setup link loop#45

Merged
Typas merged 1 commit into
masterfrom
bootstrap/shared
May 10, 2026
Merged

fix(justfile): skip real dirs in _common-setup link loop#45
Typas merged 1 commit into
masterfrom
bootstrap/shared

Conversation

@Typas

@Typas Typas commented May 10, 2026

Copy link
Copy Markdown
Owner

_common-setup linked every entry under home/ and config/ with ln -sf, which fails when the destination is a populated real directory (e.g. ~/.config/doom, ~/.config/emacs) — unlink() cannot remove a directory, so the recipe aborted.

Guard each iteration: if the destination already exists as a real directory (not a symlink), print skip <name> (real dir) and continue. Use -snf so dangling symlink-to-dir cases are also replaced cleanly. The for f in "$root/home/".* loop now uses a case filter for ./.. rather than the previous compound test that interacts poorly with set -e.

`_common-setup` linked every entry under `home/` and `config/` with
`ln -sf`, which fails when the destination is a populated real
directory (e.g. `~/.config/doom`, `~/.config/emacs`) — `unlink()`
cannot remove a directory, so the recipe aborted.

Guard each iteration: if the destination already exists as a real
directory (not a symlink), print `skip <name> (real dir)` and
continue. Use `-snf` so dangling symlink-to-dir cases are also
replaced cleanly. The `for f in "$root/home/".*` loop now uses a
`case` filter for `.`/`..` rather than the previous compound test
that interacts poorly with `set -e`.
@Typas Typas merged commit 98ca113 into master May 10, 2026
8 checks passed
@Typas Typas deleted the bootstrap/shared branch May 10, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant