mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
Travis isn't seeing our dictionary; try not copying to tmp
This commit is contained in:
parent
eda6971c59
commit
972f916e35
@ -30,13 +30,13 @@
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
dict_filename=dictionary.txt
|
||||
dict_filename=./dictionary.txt
|
||||
markdown_sources=(./src/*.md)
|
||||
mode="check"
|
||||
|
||||
# aspell repeatedly modifies personal dictionary for some purpose,
|
||||
# aspell repeatedly modifies personal dictionary when checking interactively,
|
||||
# so we should use a copy of our dictionary
|
||||
dict_path="/tmp/$dict_filename"
|
||||
dict_path="/tmp/dictionary.txt"
|
||||
|
||||
if [[ "$1" == "list" ]]; then
|
||||
mode="list"
|
||||
@ -53,11 +53,10 @@ if [[ ! -f "$dict_filename" ]]; then
|
||||
cat "${markdown_sources[@]}" | aspell --ignore 3 list | sort -u >> "$dict_filename"
|
||||
elif [[ "$mode" == "list" ]]; then
|
||||
# List (default) mode: scan all files, report errors
|
||||
cp "$dict_filename" "$dict_path"
|
||||
declare -i retval=0
|
||||
|
||||
for fname in "${markdown_sources[@]}"; do
|
||||
command=$(aspell --ignore 3 --personal="$dict_path" "$mode" < "$fname")
|
||||
command=$(aspell --ignore 3 --personal="$dict_filename" "$mode" < "$fname")
|
||||
if [[ -n "$command" ]]; then
|
||||
for error in $command; do
|
||||
# TODO: Find more correct way to get line number
|
||||
|
Loading…
Reference in New Issue
Block a user