From 6b7df50ec92de6c5cb10372f4f5b570c8b3e0b78 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Mon, 29 Jan 2024 09:40:06 +0100 Subject: [PATCH] update githook pre-commit because of egrep -> egrep: warning: egrep is obsolescent; using grep -E --- .githooks/pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index d665180..1a2573f 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -6,8 +6,8 @@ git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do # YAML or TOML frontmatter? - (egrep "^---$" $b > /dev/null) && (cat $b | sed "/---.*/,/---.*/s/^lastmod:.*$/lastmod: $(date -u "+%Y-%m-%dT%H:%M:%S%z")/" > tmp) - (egrep "^\+\+\+$" $b > /dev/null) && (cat $b | sed "/+++.*/,/+++.*/s/^lastmod.*$/lastmod = '$(date -u "+%Y-%m-%dT%H:%M:%S%z")'/" > tmp) + (grep -E "^---$" $b > /dev/null) && (cat $b | sed "/---.*/,/---.*/s/^lastmod:.*$/lastmod: $(date -u "+%Y-%m-%dT%H:%M:%S%z")/" > tmp) + (grep -E "^\+\+\+$" $b > /dev/null) && (cat $b | sed "/+++.*/,/+++.*/s/^lastmod.*$/lastmod = '$(date -u "+%Y-%m-%dT%H:%M:%S%z")'/" > tmp) mv tmp $b git add $b done