aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--default.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/default.nix b/default.nix
index 8f66761..bbb718a 100644
--- a/default.nix
+++ b/default.nix
@@ -80,15 +80,19 @@ with pkgs.stdenv; rec {
buildInputs = baseAttrs.buildInputs
++ [(hunspellWithDicts (with hunspellDicts; [en-us]))];
buildPhase = ''
- DICT="spelling/en_US-dict.txt"
- diff <(sort --ignore-case $DICT) $DICT || {
- echo "The $DICT dictionary is unsorted. To fix it, run:"
- echo " sort $DICT | sort --ignore-case | sponge $DICT"
- exit 1
- }
+ # Required by =sort= and =hunspell=
+ export LANG=C.UTF-8
+
+ for DICT in spelling/*.txt; do
+ diff <(sort $DICT) $DICT || {
+ echo "The $DICT dictionary is unsorted. To fix it, run:"
+ echo " LANG=C.UTF-8 sort $DICT | sponge $DICT"
+ exit 1
+ }
+ done
HTML_DIR="${subtasks.docs}"
- hunspell -l -p spelling/en_US-dict.txt -d en_US -i utf-8 $(find "$HTML_DIR" -type f) | tee spelling.txt
+ hunspell -l -p <(cat spelling/international.dic.txt spelling/en_US.dic.txt spelling/en_US.aff.txt) -d en_US -i utf-8 $(find "$HTML_DIR" -type f -name '*.html') | tee spelling.txt
[[ -s spelling.txt ]] && {
echo "Mispelled words detected by hunspell."
exit 1