From bfb20e5d52a4dc41a9c16ea972efb6b173855af2 Mon Sep 17 00:00:00 2001 From: WebMaster Date: Wed, 15 Feb 2017 01:06:27 -0500 Subject: [PATCH] add date hook to resolve the $DATE$ magic keyword --- .gitattributes | 2 ++ dateHook.sh | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 .gitattributes create mode 100755 dateHook.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..92be8bb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.js filter=dateHook.sh +*.html filter=dateHook.sh diff --git a/dateHook.sh b/dateHook.sh new file mode 100755 index 0000000..a2f7979 --- /dev/null +++ b/dateHook.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +lastDate=$(git log --pretty=format:"%ad" -1) +sed -e "s/\$DATE[^\$]\$/$DATE: ${lastDate}$/"