From bc858629703748e4ace70c9dd08128e55148f970 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 7 Jun 2018 18:18:19 +0200 Subject: Tweak word-counting script - make it more accurate by looking at files as they have been committed (I often leave stuff out of commits) - remove extraneous (I hope) parentheses --- update-count.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'update-count.sh') diff --git a/update-count.sh b/update-count.sh index 8ada899..f592bcb 100755 --- a/update-count.sh +++ b/update-count.sh @@ -12,7 +12,7 @@ count-leaks () while read filename do - let words+=$(wc -w ${filename} | cut -d' ' -f1) + let words+=$(git show HEAD:${filename} | wc -w | cut -d' ' -f1) let pages+=1 done @@ -23,7 +23,7 @@ count-leaks () read words pages < <(list-tracked | count-leaks) -pattern="\([0-9]*\) words in \([0-9]*\) pages" +pattern="[0-9]* words in [0-9]* pages" actual="${words} words in ${pages} pages" sed -i "s/${pattern}/${actual}/" README.md -- cgit v1.2.3