forked from colin/nix-files
scripts: add a script to clean the git dir
This commit is contained in:
parent
be84ab1f45
commit
67434caf45
19
scripts/clean
Executable file
19
scripts/clean
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
# remove artifacts which i've accidentally left lying around
|
||||
# e.g. `result -> /nix/store/...` symlinks
|
||||
|
||||
pushd ..
|
||||
for result in $(fd --follow result); do
|
||||
if [[ "$(readlink "$result")" != /nix/store/* ]]; then
|
||||
# not a build artifact
|
||||
continue
|
||||
fi
|
||||
if [[ "$result" == build/* ]] || [[ "$result" == .working/* ]]; then
|
||||
# intentionally preserved build artifact
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "removing: $result"
|
||||
unlink "$result"
|
||||
done
|
||||
popd
|
Loading…
Reference in New Issue
Block a user