diff options
author | Kevin McCarthy <kevin@8t8.us> | 2018-02-05 18:43:12 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2018-02-05 18:43:12 -0800 |
commit | fefbd81f7339573ade08d29af2bf2e8e07349da7 (patch) | |
tree | 966498a605081c1e25666cc935ae528a6278cdcf /mkreldate.sh | |
parent | 65e1f5c8f427632544bad6da22d9c80f484067f5 (diff) |
Use git to generate the release date if available.
For now, fall back to the ChangeLog. Perhaps the release date should
be generated from a file, similar to VERSION, for those cases instead.
Diffstat (limited to 'mkreldate.sh')
-rwxr-xr-x | mkreldate.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mkreldate.sh b/mkreldate.sh new file mode 100755 index 00000000..bdbffdb8 --- /dev/null +++ b/mkreldate.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Generates the reldate.h contents from either git or the ChangeLog file + +if [ -e ".git" ] && command -v git >/dev/null 2>&1; then + reldate=$(git log -1 --date=short --pretty=format:"%cd") +else + reldate=$(head -n 1 ChangeLog | LC_ALL=C cut -d ' ' -f 1) +fi + +echo 'const char *ReleaseDate = "'$reldate'";' |