diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-07-31 09:34:25 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-07-31 09:34:25 +0200 |
commit | 87dc34ab660fe91d3e77bde7548a9c6d05d28f03 (patch) | |
tree | 87b69092c57f7a38652be0842a48ec7f3da90130 | |
parent | 8aac2072a561d3cdcf2a0fed4b49ed38de7de450 (diff) |
Don’t print an error if there is no commit yet
When working on a new file, I like to auto-compile my changes with:
$ git ls-files | entr make
But since footer generation fails due to no commit existing, date(1) screams at
me. This should fix that issue.
-rw-r--r-- | include/footer.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/footer.html b/include/footer.html index 9557e17..e3235e1 100644 --- a/include/footer.html +++ b/include/footer.html @@ -7,7 +7,8 @@ m4_define(`m4___id__', m4_esyscmd(git rev-list -1 HEAD m4___caller__)) > m4_esyscmd( git log -1 --pretty='format:%cI' m4___caller__ \ - | xargs date +'%A %d %B %Y — %T %Z' -d + | ifne xargs date +'%A %d %B %Y — %T %Z' -d \ + | ifne -n echo 'No commit yet…' ) </a> </small> |