scripts/clean: fix to cleanup more dangling result symlinks

This commit is contained in:
Colin 2024-05-13 20:35:21 +00:00
parent 67434caf45
commit bef0099eec

View File

@ -2,8 +2,12 @@
# remove artifacts which i've accidentally left lying around # remove artifacts which i've accidentally left lying around
# e.g. `result -> /nix/store/...` symlinks # e.g. `result -> /nix/store/...` symlinks
pushd .. pushd ~/nixos
for result in $(fd --follow result); do
# if this exists it'll interfere with the search
rm -f result
for result in $(fd --follow result) $(fd -uuu result); do
if [[ "$(readlink "$result")" != /nix/store/* ]]; then if [[ "$(readlink "$result")" != /nix/store/* ]]; then
# not a build artifact # not a build artifact
continue continue