commit bc858629703748e4ace70c9dd08128e55148f970
parent f8d44302df32dfb23261cf969e3d88e6f1db68d6
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date: Thu, 7 Jun 2018 18:18:19 +0200
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
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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