From 2b4be475118b24eb41ab20e24922928dd4213ce5 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Mon, 29 Jan 2024 13:03:35 +0100 Subject: [PATCH] update githook pre-commit (forgot one instance of egrep) --- .githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 1a2573f..ddad515 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -4,7 +4,7 @@ # https://mademistakes.com/notes/adding-last-modified-timestamps-with-git/ # enhanced the script to either update the YAML or TOML frontmatter (as i used both O_o) -git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do +git diff --cached --name-status | grep -E -i "^(A|M).*\.(md)$" | while read a b; do # YAML or TOML frontmatter? (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)