]> git.nbdom.net Git - nb.git/commitdiff
.githooks/pre-commit
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 8 Oct 2024 20:16:47 +0000 (22:16 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 8 Oct 2024 20:16:47 +0000 (22:16 +0200)
.githooks/pre-commit
bin/git-setup-hooks.sh [new file with mode: 0755]
www/dbq/html/default.css

index 01c0d3520175a404d0572f83ab877ca99acaef58..6e538657f010b2276cf4769f994069e1291c5210 100755 (executable)
@@ -13,7 +13,7 @@ MINIFY=""
 [ -z "$MINIFY" ] && minify --help 2>&1| grep -q '\-\-css' && MINIFY="ext"
 [ -z "$MINIFY" ] && minify --help 2>&1| grep -q '\-\-output' && MINIFY="out"
 [ -n "$MINIFY" ] || exit
-git status --porcelain|sed -E 's/^ *(\?\?|[A-Z]) +//'
+#git status --porcelain|sed -E 's/^ *(\?\?|[A-Z]) +//'
 #exec echo BYE
 
 git status --porcelain|sed -E 's/^ *(\?\?|[A-Z]) +//' | while read file; do
diff --git a/bin/git-setup-hooks.sh b/bin/git-setup-hooks.sh
new file mode 100755 (executable)
index 0000000..f734f39
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+# setup-hooks.sh
+
+# Ensure this script is run from the root of the repository
+REPO_ROOT=$(git rev-parse --show-toplevel)
+[ -n "$REPO_ROOT" ] || exit
+
+HOOKS_DIR="$REPO_ROOT/.githooks"
+GIT_HOOKS_DIR="$REPO_ROOT/.git/hooks"
+
+# Copy or symlink the pre-commit hook
+#echo "Setting up Git hooks..."
+[ -d "$HOOKS_DIR" ] || exit
+
+for hook in "$HOOKS_DIR"/*; do
+  hook_name=$(basename "$hook")
+  [ -e "$GIT_HOOKS_DIR/$hook_name" ] && stat --format '%N' "$GIT_HOOKS_DIR/$hook_name" \
+    | grep -q "\-> '$HOOKS_DIR/$hook_name'$" \
+  && continue
+  echo "  Installing Git hook $hook_name"
+  ln -sf "$HOOKS_DIR/$hook_name" "$GIT_HOOKS_DIR/$hook_name"
+done
+# NB 08.10.24 else
+# NB 08.10.24 echo "No hooks found in $HOOKS_DIR."
index 6d0c3c43b854e8d7337b940fcab5a6552ca6b0c1..b966da80943c5ac6ac9eac995e53305e4b8593b2 100644 (file)
@@ -121,7 +121,7 @@ a.active, .active a {
        display: list-item;
 }
 
-.todel-test6,
+.todel-test7,
 .db-rows div.list .list.item.capitalize {
        text-transform: capitalize;
        list-style: circle inside none;