From 9cd12b51596b1df62d3f1ea78d1e635aeb7f62b1 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 8 Oct 2024 21:03:52 +0200 Subject: [PATCH] bin/git-setup-hooks.sh --- .githooks/pre-commit | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 55a70ee8..a6f74760 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,12 +1,18 @@ #!/bin/bash -l +# NB 12.03.19 echo DEBUG: pre-commit $* 1>&2 +# NB 12.03.19 [ -d www/dbq/ ] && (cd www/dbq/ && minify_dir) | while read -r f; do +# NB 12.03.19 echo "Minify $f" +# NB 12.03.19 git add "$f" +# NB 12.03.19 done + echo "Run $0" if which minify > /dev/null; then MINIFY="" - [ -z "$MINIFY" ] && minify --help 2>&1| grep -q '\-\-css ' && MINIFY="ext" - [ -z "$MINIFY" ] && minify --help 2>&1| grep -q '\-\-output' && MINIFY="out" - [ -z "$MINIFY" ] || git status --porcelain | sed 's/^ *[A-Z] \+//' | 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 's/^ . //' | while read file; do ext="" case "$file" in *.min.*) continue ;; -- 2.47.3