From 9dfca25455dbac7fad721bac44daa9d9a149475a Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 12 Mar 2020 22:40:41 +0100 Subject: Make hooks easier to setup & maintain By giving them meaningful names and adding a master script to call them all. --- scripts/pre-push | 5 ----- scripts/update-count.sh | 29 ----------------------------- 2 files changed, 34 deletions(-) delete mode 100755 scripts/pre-push delete mode 100755 scripts/update-count.sh (limited to 'scripts') diff --git a/scripts/pre-push b/scripts/pre-push deleted file mode 100755 index d0c019d..0000000 --- a/scripts/pre-push +++ /dev/null @@ -1,5 +0,0 @@ -#/bin/bash - -echo "Checking for unresolved links…" - -! grep -Er '^\[.*\]:.*TODO.*' diff --git a/scripts/update-count.sh b/scripts/update-count.sh deleted file mode 100755 index d0a094e..0000000 --- a/scripts/update-count.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -list-tracked () -{ - GIT_LITERAL_PATHSPECS='' git ls-files '*.md' '*.org' -} - -count-leaks () -{ - let pages=0 - let words=0 - - while read filename - do - let words+=$(git show HEAD:${filename} | wc -w | cut -d' ' -f1) - let pages+=1 - done - - echo ${words} ${pages} -} - - - -read words pages < <(list-tracked | count-leaks) - -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