mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-01 07:59:05 +08:00
Exit training script if run command failed; fixes #2005
This commit is contained in:
parent
5a4288f2fc
commit
486940687c
@ -47,7 +47,7 @@ echo -e "USAGE: tesstrain.sh
|
||||
}
|
||||
|
||||
source "$(dirname $0)/tesstrain_utils.sh"
|
||||
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
|
||||
if [[ $# -eq 0 || "$1" == "--help" || "$1" == "-h" ]]; then
|
||||
display_usage
|
||||
exit 0
|
||||
fi
|
||||
|
@ -16,6 +16,13 @@
|
||||
#
|
||||
# USAGE: source tesstrain_utils.sh
|
||||
|
||||
if [ -n "$BASH_VERSION" ];then
|
||||
set -u # comment in case of "unbound variable" error or fix the code
|
||||
set -eo pipefail;
|
||||
else
|
||||
echo "Warning: you aren't running script in bash - expect problems..."
|
||||
fi
|
||||
|
||||
UNAME=$(uname -s | tr 'A-Z' 'a-z')
|
||||
LANG_CODE="ENG"
|
||||
TIMESTAMP=`date +%Y-%m-%d`
|
||||
|
Loading…
Reference in New Issue
Block a user