From 3a94df050166da6bf9fc3fda584b69816779d865 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 23 Jul 2021 15:13:23 -0300 Subject: aux/: Update --- aux/workflow/assert-spelling.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'aux/workflow/assert-spelling.sh') diff --git a/aux/workflow/assert-spelling.sh b/aux/workflow/assert-spelling.sh index 3781454..f1eef6f 100755 --- a/aux/workflow/assert-spelling.sh +++ b/aux/workflow/assert-spelling.sh @@ -1,11 +1,13 @@ #!/bin/sh set -eu +. aux/lib.sh + sort_dicts() { - for f in doc/spelling/*.txt; do + for f in po/spelling/*.txt; do if ! LANG=POSIX sort "$f" | diff - "$f"; then if [ "$IN_PLACE" = true ]; then - OUT="$(mktemp)" + OUT="$(mkstemp)" LANG=POSIX sort "$f" | uniq > "$OUT" mv "$OUT" "$f" else @@ -44,8 +46,8 @@ assert_arg() { assert_arg "${LANGS:-}" '-l LANGS' -mkdir -p doc/spelling -eval "touch doc/spelling/{international,$(echo "$LANGS" | tr ' ' ,)}.txt" +mkdir -p po/spelling +eval "touch po/spelling/{international,$(echo "$LANGS" | tr ' ' ,)}.txt" get_lang() { grep lang=.. "$1" | \ @@ -57,11 +59,11 @@ get_lang() { ' } -ACC="$(mktemp)" +ACC="$(mkstemp)" for f in "$@"; do l="$(get_lang "$f")" - CURR_DICT="$(mktemp)" - cat doc/spelling/international.txt "doc/spelling/$l.txt" | sort | uniq > "$CURR_DICT" + CURR_DICT="$(mkstemp)" + cat po/spelling/international.txt "po/spelling/$l.txt" | sort | uniq > "$CURR_DICT" hunspell -u3 -H -d "$l" -p "$CURR_DICT" "$f" | tee -a "$ACC" >&2 done -- cgit v1.2.3