update githook pre-commit because of egrep

-> egrep: warning: egrep is obsolescent; using grep -E
main
Dominic Reich 10 months ago
parent 5b4f1dc95c
commit 6b7df50ec9
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -6,8 +6,8 @@
git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do
# YAML or TOML frontmatter? # YAML or TOML frontmatter?
(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)
(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)
mv tmp $b mv tmp $b
git add $b git add $b
done done

Loading…
Cancel
Save