Add a nix package

This commit is contained in:
Sven van Heugten 2026-02-22 06:34:38 +01:00
parent e77a4ee485
commit 4fe66154c3
No known key found for this signature in database
GPG key ID: D612F88666F4F660
2 changed files with 6 additions and 0 deletions

View file

@ -14,6 +14,11 @@
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.writeShellApplication {
name = "git-check-assertions";
runtimeInputs = [ pkgs.git ];
text = builtins.readFile ./git-check-assertions.sh;
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [ bats ];
};

View file

@ -41,6 +41,7 @@ for commit_hash in "${commits[@]}"; do
echo "Checking out $commit_hash"
git -c advice.detachedHead=false checkout -q "$commit_hash"
commit_msg="$(git log -1 --format=%B "$commit_hash")"
# shellcheck disable=SC2016
block="$(printf '%s\n' "$commit_msg" \
| sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' \
| sed '1d;$d')"