update githook pre-commit because of egrep
-> egrep: warning: egrep is obsolescent; using grep -E
This commit is contained in:
parent
5b4f1dc95c
commit
6b7df50ec9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue