diff --git a/README.md b/README.md index d5a9532..1fad206 100644 --- a/README.md +++ b/README.md @@ -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/`. diff --git a/flake.nix b/flake.nix index 8b75377..22d36c1 100644 --- a/flake.nix +++ b/flake.nix @@ -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/ + ''); + }; }); }