Add postgrest-docs-dictcheck to remove obsolete words from postgrest.dict

This commit is contained in:
Wolfgang Walther
2020-11-29 23:54:48 +01:00
committed by Wolfgang Walther
parent b83ee94fae
commit 84e5597091
3 changed files with 16 additions and 4 deletions
+15
View File
@@ -57,4 +57,19 @@ in
| tee misspellings
test ! -s misspellings
'';
# dictcheck detects obsolete entries in postgrest.dict, that are not used anymore
dictcheck =
pkgs.writeShellScriptBin "postgrest-docs-dictcheck"
''
set -euo pipefail
FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ')
cat postgrest.dict \
| tail -n+2 \
| tr '\n' '\0' \
| xargs -0 -n 1 -i \
sh -c "grep \"{}\" $FILES > /dev/null || echo \"{}\""
'';
}