mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
03cf883a46
[DOCS-256]: https://hasurahq.atlassian.net/browse/DOCS-256?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7520 GitOrigin-RevId: 41ae163de3747164ef4b01cfcd155ecb941510bb
26 lines
857 B
Bash
Executable File
26 lines
857 B
Bash
Executable File
# Using cspell, we'll loop over each subdirectory inside ./docs and check every mdx file for spelling errors.
|
|
# If there is an error, we'll write the word to an output file
|
|
|
|
# prep
|
|
if [ -f spell_check_results.txt ]; then
|
|
rm spell_check_results.txt
|
|
fi
|
|
cd docs
|
|
|
|
# first check, over the mdx files in the root directory
|
|
find . -maxdepth 1 -type f -name "*.mdx" -exec cspell --words-only {} \; >> ../output.txt
|
|
|
|
# loop over each subdirectory and any directories inside
|
|
for dir in */; do
|
|
find $dir -type d -exec cspell --words-only {}/*.mdx \; >> ../output.txt
|
|
done
|
|
|
|
# loop over each line in the output file and prune duplications
|
|
cd ../
|
|
awk '!a[$0]++' output.txt > spell_check_results.txt
|
|
rm output.txt
|
|
|
|
# check the number of lines in spell_check_results.txt
|
|
lines=$(wc -l < spell_check_results.txt)
|
|
|
|
echo "There are $lines spelling errors or unknown words." |