add date hook to resolve the $DATE$ magic keyword

This commit is contained in:
WebMaster
2017-02-15 01:06:27 -05:00
parent 0903cc39ad
commit bfb20e5d52
2 changed files with 6 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
*.js filter=dateHook.sh
*.html filter=dateHook.sh

4
dateHook.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
lastDate=$(git log --pretty=format:"%ad" -1)
sed -e "s/\$DATE[^\$]\$/$DATE: ${lastDate}$/"