forked from extern/flakelight
Clean up git pre-commit hook package
This commit is contained in:
parent
1c8ac213b0
commit
3a26542b83
@ -3,7 +3,7 @@ _: {
|
||||
if [ -f flake.nix ] && [ -d .git/hooks ] &&
|
||||
[ ! -f .git/hooks/pre-commit ]; then
|
||||
echo Installing git pre-commit hook...
|
||||
cp ${lib.getExe flakelite.inputs'.flakelite.packages.pre-commit
|
||||
cp ${lib.getExe flakelite.inputs'.flakelite.packages.pre-commit-hook
|
||||
} .git/hooks
|
||||
fi
|
||||
'';
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
TREE=$(mktemp -d)
|
||||
git archive "$(git write-tree)" | tar -xC "$TREE"
|
||||
nix flake check "$TREE"
|
@ -6,5 +6,9 @@
|
||||
writeShellApplication {
|
||||
name = "pre-commit";
|
||||
runtimeInputs = [ nix git gnutar ];
|
||||
text = builtins.readFile ./pre-commit;
|
||||
text = ''
|
||||
TREE=$(mktemp -d)
|
||||
git archive "$(git write-tree)" | tar -xC "$TREE"
|
||||
nix flake check "$TREE"
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user