diff options
author | EuAndreh <eu@euandre.org> | 2019-06-01 08:35:57 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-01 08:36:43 -0300 |
commit | e34e717c269eadfa36425d753f82be8e93cd8754 (patch) | |
tree | 6d37a6fd214c62f5dc522d4f578b14571acd6432 /spelling | |
parent | Format Nix code (linter offense) (diff) | |
download | euandre.org-e34e717c269eadfa36425d753f82be8e93cd8754.tar.gz euandre.org-e34e717c269eadfa36425d753f82be8e93cd8754.tar.xz |
Fix check-spelling.sh linter offenses
Diffstat (limited to '')
-rwxr-xr-x | spelling/check-spelling.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spelling/check-spelling.sh b/spelling/check-spelling.sh index 7656dc4..fb86abe 100755 --- a/spelling/check-spelling.sh +++ b/spelling/check-spelling.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail HTML_DIR="${1:-}" [[ -z "${HTML_DIR}" ]] && { - echo 'Undefined HTML_DIR.' + echo 'Undefined input HTML_DIR.' exit 2 } @@ -11,7 +11,7 @@ HTML_DIR="${1:-}" export LANG=C.UTF-8 for DICT in spelling/*.txt; do - diff <(sort $DICT) $DICT || { + 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 @@ -20,10 +20,11 @@ done 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 cat spelling.txt -[[ -s spelling.txt ]] && { + +if [[ -s spelling.txt ]]; then echo "Mispelled words detected by hunspell." cat spelling.txt exit 1 -} || { +else echo "No words mispelled" -} +fi |