27 lines
832 B
Bash
27 lines
832 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
errored=0
|
||
|
abstracts_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../src/abstracts/
|
||
|
|
||
|
for file in abstract-en.tex abstract-fr.tex; do
|
||
|
char=$(cat $abstracts_dir/$file | wc -m)
|
||
|
if [ $char -gt 4000 ]; then
|
||
|
errored=1
|
||
|
echo -e >&2 "\x1B[31;1merror:\x1B[0m $file has more than 4000 characters"
|
||
|
else
|
||
|
echo -e >&2 "\x1B[32;1msuccess:\x1B[0m $file passes the test ($char characters)"
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
for file in abstract-simple-en.tex abstract-simple-fr.tex; do
|
||
|
char=$(cat $abstracts_dir/$file | wc -m)
|
||
|
if [ $char -gt 1000 ]; then
|
||
|
errored=1
|
||
|
echo -e >&2 "\x1B[31;1merror:\x1B[0m $file has more than 1000 characters"
|
||
|
else
|
||
|
echo -e >&2 "\x1B[32;1msuccess:\x1B[0m $file passes the test ($char characters)"
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
exit $errored
|