From a60737240db34d2e132c222dac745ae1a43daa65 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 8 Oct 2024 22:16:47 +0200 Subject: [PATCH] .githooks/pre-commit --- .githooks/pre-commit | 2 +- bin/git-setup-hooks.sh | 24 ++++++++++++++++++++++++ www/dbq/html/default.css | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 bin/git-setup-hooks.sh diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 01c0d352..6e538657 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -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 index 00000000..f734f39d --- /dev/null +++ b/bin/git-setup-hooks.sh @@ -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." diff --git a/www/dbq/html/default.css b/www/dbq/html/default.css index 6d0c3c43..b966da80 100644 --- a/www/dbq/html/default.css +++ b/www/dbq/html/default.css @@ -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; -- 2.47.3