|
|
|
@ -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
|
|
|
|
|