feat: pre-commit-hook to cleanup leftover example artifacts

This commit is contained in:
DavHau 2022-07-29 14:17:40 +02:00
parent 97243aa70a
commit 130d71f9d5

View File

@ -318,6 +318,17 @@
${pkgs.treefmt}/bin/treefmt --clear-cache --fail-on-change
'');
};
cleanup = {
enable = true;
name = "cleaned";
entry = l.toString (pkgs.writeScript "cleaned" ''
#!${pkgs.bash}/bin/bash
for badFile in $(find ./examples | grep 'flake.lock\|dream2nix-packages'); do
rm -rf $badFile
git add $badFile || :
done
'');
};
is-cleaned = {
enable = true;
name = "is-cleaned";