]> git.nbdom.net Git - nb.git/commitdiff
bin/git-setup-hooks.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 8 Oct 2024 19:03:52 +0000 (21:03 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 8 Oct 2024 19:03:52 +0000 (21:03 +0200)
.githooks/pre-commit

index 55a70ee83060fb24f83af7736c4145a232c8131e..a6f7476041b1db37787149994241a56cb340c49e 100755 (executable)
@@ -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 ;;