textract-memecount.sh: exit gracefully if memecount.log is up to date - bitreic… | |
git clone git://src.adamsgaard.dk/bitreich-memestats | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit e5ead53b455dbe7e7da13ca55e6a52b736aa2de5 | |
parent 59cc23745f7cb078911587bfaf9a729f69118c30 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 30 Aug 2021 18:36:30 +0200 | |
extract-memecount.sh: exit gracefully if memecount.log is up to date | |
Signed-off-by: Christoph Lohmann <[email protected]> | |
Diffstat: | |
M extract-memecount.sh | 6 +++++- | |
1 file changed, 5 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/extract-memecount.sh b/extract-memecount.sh | |
t@@ -12,6 +12,7 @@ memefile="modules/hashtags/hashtags.txt" | |
update_annna=yes | |
outputfile="${2:-memecount.log}" | |
revisionrange="" | |
+datefmt="%Y-%m-%d" | |
if [ ! -e "${annnadir}/${memefile}" ]; then | |
printf 'error: could not open %s\n' "${annnadir}/${memefile}" | |
t@@ -21,6 +22,9 @@ fi | |
if [ -f "${outputfile}" ]; then | |
lastrevision="$(tail -n 1 "${outputfile}" | cut -f 2)" | |
revisionrange="${lastrevision}..HEAD" | |
+ if [ "$(date +"${datefmt}")" = "$(tail -n 1 "${outputfile}" | cut -f 1… | |
+ exit | |
+ fi | |
else | |
firstrevision="$(cd "${annnadir}" && git rev-list --max-parents=0 HEAD… | |
revisionrange="${firstrevision}..HEAD" | |
t@@ -41,7 +45,7 @@ fi | |
headcommit="$(git rev-parse HEAD)" | |
i=0 | |
# derived from Hiltjo Posthuma's loc.sh | |
-(cd "${annnadir}" && git log --pretty='format:%H %cd %at' --date="format:%Y-%m… | |
+(cd "${annnadir}" && git log --pretty='format:%H %cd %at' --date="format:${dat… | |
"${revisionrange}") | \ | |
sort -k 2 | uniq -f 1 | \ | |
while read -r commit date timestamp; do |