From fb6d0d41a598a7cf51e7a746008eb2aabb496b20 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Mon, 10 Apr 2023 09:55:29 +0200 Subject: [PATCH] update lastmod git-hook --- .githooks/pre-commit | 4 ++-- content/links/index.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 2629212..76111d5 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -3,8 +3,8 @@ # Replace `last_modified_at` timestamp with current time # https://mademistakes.com/notes/adding-last-modified-timestamps-with-git/ -git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do - cat $b | sed "/---.*/,/---.*/s/^lastmod =.*$/lastmod = \'$(date -u "+%Y-%m-%dT%H:%M:%S%z")\'/" > tmp +git diff --cached --name-status | grep -E -i "^(A|M).*\.(md)$" | while read a b; do + cat $b | sed "/+++.*/,/+++.*/s/^lastmod.*$/lastmod = '$(date -u "+%Y-%m-%dT%H:%M:%S%z")'/" > tmp mv tmp $b git add $b done diff --git a/content/links/index.md b/content/links/index.md index 6e587a6..cacd713 100644 --- a/content/links/index.md +++ b/content/links/index.md @@ -2,7 +2,7 @@ title = "Links" summary = """Listing links of (hopefully) useful websites""" date = "2022-11-20T15:56:36+0100" -lastmod = '2023-04-10T09:25:37+0200' +lastmod = '2023-04-10T08:06:48+0000' comment = false