@@ -6,19 +6,24 @@ set -ex
66
77trap " echo -e '\x1b[01;31mFailed\x1b[0m'" ERR
88
9- echo ' This is okay.' | python -m language_tool_python -
10- ! echo ' This is noot okay.' | python -m language_tool_python -
9+ exit_status=0
1110
12- echo ' This is okay.' | python -m language_tool_python -
13- ! echo ' This is noot okay.' | python -m language_tool_python -
11+ echo ' This is okay.' | python -m language_tool_python - || exit_status=1
12+ echo ' This is noot okay.' | python -m language_tool_python - && exit_status=1
1413
15- echo ' These are “smart” quotes.' | python -m language_tool_python -
16- ! echo ' These are "dumb" quotes.' | python -m language_tool_python -
17- ! echo ' These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
18- --enable=EN_QUOTES -
14+ echo ' This is okay.' | python -m language_tool_python - || exit_status=1
15+ echo ' This is noot okay.' | python -m language_tool_python - && exit_status=1
16+
17+ echo ' These are “smart” quotes.' | python -m language_tool_python - || exit_status=1
18+ echo ' These are "dumb" quotes.' | python -m language_tool_python - && exit_status=1
19+ echo ' These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
20+ --enable=EN_QUOTES - && exit_status=1
1921echo ' These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
20- --enable=EN_UNPAIRED_BRACKETS -
22+ --enable=EN_UNPAIRED_BRACKETS - || exit_status=1
2123
22- echo ' # These are "dumb".' | python -m language_tool_python --ignore-lines=' ^#' -
24+ echo ' # These are "dumb".' | python -m language_tool_python --ignore-lines=' ^#' - || exit_status=1
2325
24- echo -e ' \x1b[01;32mOkay\x1b[0m'
26+ if [[ " $exit_status " == 0 ]]; then
27+ echo -e ' \x1b[01;32mOkay\x1b[0m'
28+ fi
29+ exit " $exit_status "
0 commit comments