File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,14 @@ if [[ -n "$(git ls-files '*Cargo.toml')" ]]; then
46
46
fi
47
47
config_old=$( < .cspell.json)
48
48
config_new=$( grep <<< " ${config_old}" -v ' *//' | jq ' del(.dictionaries[])' | jq ' del(.dictionaryDefinitions[])' )
49
+ trap -- ' echo "${config_old}" >.cspell.json; echo >&2 "$0: trapped SIGINT"; exit 1' SIGINT
49
50
echo " ${config_new} " > .cspell.json
50
51
if [[ -n " ${has_rust} " ]]; then
51
- dependencies_words=$( npx <<< " ${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true)
52
+ dependencies_words=$( npx <<< " ${dependencies}" -y cspell stdin --no-progress --no-summary --words-only --unique || true)
52
53
fi
53
- all_words=$( npx cspell --no-progress --no-summary --words-only --unique $( git ls-files | (grep -v " ${project_dictionary// \. / \\ .} " || true)) || true)
54
- # TODO: handle SIGINT
54
+ all_words=$( npx -y cspell --no-progress --no-summary --words-only --unique $( git ls-files | (grep -v " ${project_dictionary// \. / \\ .} " || true)) || true)
55
55
echo " ${config_old} " > .cspell.json
56
+ trap - SIGINT
56
57
cat > .github/.cspell/rust-dependencies.txt << EOF
57
58
// This file is @generated by $( basename " $0 " ) .
58
59
// It is not intended for manual editing.
@@ -62,8 +63,8 @@ if [[ -n "${dependencies_words:-}" ]]; then
62
63
fi
63
64
check_diff .github/.cspell/rust-dependencies.txt
64
65
65
- echo " + npx cspell --no-progress --no-summary \$ (git ls-files)"
66
- if ! npx cspell --no-progress --no-summary $( git ls-files) ; then
66
+ echo " + npx -y cspell --no-progress --no-summary \$ (git ls-files)"
67
+ if ! npx -y cspell --no-progress --no-summary $( git ls-files) ; then
67
68
error " spellcheck failed: please fix uses of above words or add to ${project_dictionary} if correct"
68
69
fi
69
70
You can’t perform that action at this time.
0 commit comments