Skip to content

Commit

Permalink
Added the same --tmp_dir flag to tesstrain_utils.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Armyke committed Mar 4, 2019
1 parent 25fa392 commit 56b04d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/training/tesstrain_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ parse_flags() {
--fonts_dir)
parse_value "FONTS_DIR" ${ARGV[$j]:-}
i=$j ;;
--tmp_dir)
parse_value "TMP_DIR" ${ARGV[$j]:-}
i=$j ;;
--lang)
parse_value "LANG_CODE" ${ARGV[$j]:-}
i=$j ;;
Expand Down Expand Up @@ -215,7 +218,11 @@ parse_flags() {

# Location where intermediate files will be created.
TIMESTAMP=$(date +%Y-%m-%d)
TMP_DIR=$(mktemp -d -t ${LANG_CODE}-${TIMESTAMP}.XXX)
if [[ -z ${TMP_DIR:-} ]]; then
TMP_DIR=$(mktemp -d -t ${LANG_CODE}-${TIMESTAMP}.XXX)
else
TMP_DIR=$(mktemp -d -p ${TMP_DIR} -t ${LANG_CODE}-${TIMESTAMP}.XXX)
fi
TRAINING_DIR=${TMP_DIR}
# Location of log file for the whole run.
LOG_FILE=${TRAINING_DIR}/tesstrain.log
Expand Down

0 comments on commit 56b04d4

Please sign in to comment.