From: Nicolas Boisselier Date: Tue, 8 Oct 2024 22:37:09 +0000 (+0200) Subject: .githooks/pre-commit X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=4fc41d652c0bdbdee929e57c7725411175ad7bf4;p=nb.git .githooks/pre-commit --- diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a6f74760..92813774 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -10,9 +10,9 @@ echo "Run $0" if which minify > /dev/null; then MINIFY="" - [ -z "$MINIFY" ] && minify --help | grep -q '\-\-css' && MINIFY="ext" - [ -z "$MINIFY" ] && minify --help | grep -q '\-\-output' && MINIFY="out" - [ -z "$MINIFY" ] || git status --porcelain | sed 's/^ . //' | while read file; do + [ -z "$MINIFY" ] && minify --help | grep -q '\-\-css ' && MINIFY="ext" + [ -z "$MINIFY" ] && minify --help | grep -q '\-\-output ' && MINIFY="out" + [ -z "$MINIFY" ] || git status --porcelain|sed -E 's/^ *(\?\?|[A-Z]) +//' | while read file; do ext="" case "$file" in *.min.*) continue ;;