summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2018-06-07 18:18:19 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2018-06-07 18:18:19 +0200
commitbc858629703748e4ace70c9dd08128e55148f970 (patch)
treebccd9746796931be50b3f89dbbcaf76697cc7e03
parentf8d44302df32dfb23261cf969e3d88e6f1db68d6 (diff)
downloadmemory-leaks-bc858629703748e4ace70c9dd08128e55148f970.tar.xz
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
-rwxr-xr-xupdate-count.sh4
1 files changed, 2 insertions, 2 deletions
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