]> git.scottworley.com Git - pinch/blame - git-pre-commit-hook
Start on 3.0.2
[pinch] / git-pre-commit-hook
CommitLineData
d2d9efef
SW
1#!/usr/bin/env bash
2
3# Copy me to .git/hooks/pre-commit
4
5set -e
6
7cleanup() {
8 if [[ "$D" && -e "$D" ]];then
9 rm -rf "$D"
10 fi
11}
12trap cleanup EXIT
13
14D=$(mktemp -d)
15[[ "$D" && -d "$D" ]]
16
17git checkout-index --prefix="$D/" -a
18pushd "$D"
19
420bd8c9 20nix-shell --arg lint true --run './test.sh lint'
d2d9efef
SW
21
22popd