add a `nix run '.#clean'` rule

This commit is contained in:
Colin 2023-07-06 22:39:39 +00:00
parent c9d79b0734
commit e3736f7f1b
2 changed files with 11 additions and 0 deletions

View File

@ -19,4 +19,6 @@ roughly:
2. `tree-sitter generate`
3. `tree-sitter test`
run `nix run '.#clean'` before committing to avoid checking in build artifacts.
the parser is defined in `grammar.js`, and tests live in `corpus/`.

View File

@ -16,5 +16,14 @@
defaultPackage = packages.tree-sitter-nixshell;
devShells.default = pkgs.callPackage ./shell.nix { };
apps.clean = {
type = "app";
program = builtins.toString (pkgs.writeShellScript "clean" ''
# remove build artifacts
rm -f Cargo.toml binding.gyp
rm -rf bindings/ src/
'');
};
});
}