forked from igsekor/pyspelling-any
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
43 lines (32 loc) · 1.06 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh -l
SPELLCHECK_CONFIG_FILE=''
if [ -f "./.spellcheck.yml" ]; then
SPELLCHECK_CONFIG_FILE=".spellcheck.yml"
elif [ -f "./.spellcheck.yaml" ]; then
SPELLCHECK_CONFIG_FILE=".spellcheck.yaml"
elif [ -f "./spellcheck.yml" ]; then
SPELLCHECK_CONFIG_FILE="spellcheck.yml"
else
SPELLCHECK_CONFIG_FILE="spellcheck.yaml"
fi
echo ""
echo ">>> Tools & Versions"
echo "> python $(python --version)"
echo ""
echo "> pip3 $(pip --version)"
echo ""
echo "> pyspelling $(pip3 show pyspelling)"
echo ""
echo "> pyyaml $(pip3 show pyyaml)"
echo "<<<"
echo ""
echo "Starting..."
echo "Setup languages and spelling tool..."
apt-get install -y $(python /extract-lang.py $SPELLCHECK_CONFIG_FILE)
rm -rf /var/lib/apt/lists/*
echo "Using PySpelling according to configuration from $SPELLCHECK_CONFIG_FILE"
pyspelling --config $SPELLCHECK_CONFIG_FILE
EXITCODE=$?
test $EXITCODE -gt 1 && echo "\033[91Spelling check action failed, please check diagnostics\033[39m";
test $EXITCODE -eq 1 && echo "\033[91mFiles in repository contain spelling errors\033[39m";
exit $EXITCODE