From b5028afd6db466ac6ab8528a6f9a5fcd6d1fdb8a Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 27 Dec 2023 01:15:39 +0100 Subject: Source published date from git if not in the file itself --- atom.xml.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'atom.xml.sh') diff --git a/atom.xml.sh b/atom.xml.sh index 157a924..ce74d94 100755 --- a/atom.xml.sh +++ b/atom.xml.sh @@ -11,6 +11,9 @@ meta () { dates () { local published=$(meta "published-on" "$1") + if [ -z "$published" ]; then + published=$(git rev-list --no-commit-header --pretty=%aI HEAD -- "$1" | tail -n1) + fi local modified=$(git rev-list --after="2023-12-27 00:45+01:00" -1 --no-commit-header --pretty=%aI HEAD -- "$1") [ -z "$modified" ] && modified=$(meta "last-modified-on" "$1") [ -z "$modified" ] && modified=$published -- cgit v1.1