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 ] &&
|
if [ -f flake.nix ] && [ -d .git/hooks ] &&
|
||||||
[ ! -f .git/hooks/pre-commit ]; then
|
[ ! -f .git/hooks/pre-commit ]; then
|
||||||
echo Installing git pre-commit hook...
|
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
|
} .git/hooks
|
||||||
fi
|
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 {
|
writeShellApplication {
|
||||||
name = "pre-commit";
|
name = "pre-commit";
|
||||||
runtimeInputs = [ nix git gnutar ];
|
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