Commit 22bbf830 authored by Ewa Smula's avatar Ewa Smula
Browse files

test spell check added

parent 9ea43c3a
lcsb
Université
# In case something goes horribly wrong, you can fall back to `image: ruby:latest`
image: git-r3lab.uni.lu:4567/r3/docker/jekyll-lcsb:1.0
build the website:
build:
stage: build
before_script:
- gem install bundler -v2.0.2
......@@ -18,6 +18,20 @@ build the website:
variables:
JEKYLL_ENV: production
test_spell_check:
image: debian
stage: test
dependencies:
- build
script:
- apt-get update
- apt-get install -y aspell aspell-en
- ./test_spell_check.sh
except:
- master
pages:
stage: deploy
only:
......
#!/bin/bash
set -e
#set en_GB for British English
aspell_lang=en
echo "Spell checking"
spell_check_code=0
for x in $(find test/ -name '*.html');
do
lines=`cat $x|aspell --lang=$aspell_lang --encoding=utf-8 --mode html --add-extra-dicts=./.aspell.en.pws list 2>errors.txt |wc -l`
if [ $lines -gt 0 ]
then
echo $x:
cat $x | aspell --lang=$aspell_lang --encoding=utf-8 --mode html --add-extra-dicts=./.aspell.en.pws list
spell_check_code=1
echo
fi
# we need to check stderr - in case something really bad happens there will be output there
lines=`cat errors.txt | wc -l`
if [ $lines -gt 0 ]
then
cat errors.txt
spell_check_code=1
fi
done
if [ $spell_check_code -gt 0 ]
then
echo "Spell check found some problems. Either fix them or add exceptions to the dictionary file: .aspell.en.pws"
fi
rm errors.txt
exit $spell_check_code
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment