mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
Revert "Travis isn't seeing our dictionary; try not copying to tmp"
This reverts commit 972f916e35
.
This commit is contained in:
parent
ad2fc2bcf0
commit
5aec311b09
@ -36,9 +36,9 @@ dict_filename=dictionary.txt
|
||||
markdown_sources=(./src/*.md)
|
||||
mode="check"
|
||||
|
||||
# aspell repeatedly modifies personal dictionary when checking interactively,
|
||||
# aspell repeatedly modifies personal dictionary for some purpose,
|
||||
# so we should use a copy of our dictionary
|
||||
dict_path="/tmp/dictionary.txt"
|
||||
dict_path="/tmp/$dict_filename"
|
||||
|
||||
if [[ "$1" == "list" ]]; then
|
||||
mode="list"
|
||||
@ -55,11 +55,11 @@ 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
|
||||
echo "command = aspell --home-dir=. --ignore 3 --personal=\"$dict_filename\" \"$mode\" < \"$fname\""
|
||||
command=$(aspell --home-dir=. --ignore 3 --personal="$dict_filename" "$mode" < "$fname")
|
||||
command=$(aspell --ignore 3 --personal="$dict_path" "$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