From: Nicolas Boisselier Date: Tue, 8 Oct 2024 19:03:52 +0000 (+0200) Subject: bin/git-setup-hooks.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9cd12b51596b1df62d3f1ea78d1e635aeb7f62b1;p=nb.git bin/git-setup-hooks.sh --- 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 ;;