Skip to content

Commit dbfc89f

Browse files
committed
Fix mktemp in tesstrain_utils.sh
The commit 10f2c45 unified the usage of mktemp, but with a incorrect bash syntax and unnecessary definition of LANG_CODE and TIMESTAMP. This patch fixes the above problems.
1 parent ec476f9 commit dbfc89f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/training/tesstrain_utils.sh

+4-6
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@ else
2424
fi
2525

2626
UNAME=$(uname -s | tr 'A-Z' 'a-z')
27-
LANG_CODE="ENG"
28-
TIMESTAMP=`date +%Y-%m-%d`
2927

3028
case $UNAME in
3129
darwin | *freebsd | dragonfly | cygwin*)
32-
MKTEMP_DT=$(mktemp -d -t)
30+
MKTEMP_DT="mktemp -d -t"
3331
;;
3432
* )
35-
MKTEMP_DT=$(mktemp -d --tmpdir)
33+
MKTEMP_DT="mktemp -d --tmpdir"
3634
;;
3735
esac
38-
FONT_CONFIG_CACHE=(${MKTEMP_DT} font_tmp.XXXXXXXXXX)
36+
FONT_CONFIG_CACHE=$(${MKTEMP_DT} font_tmp.XXXXXXXXXX)
3937

4038
if [[ ($UNAME == *darwin*) ]]; then
4139
FONTS_DIR="/Library/Fonts/"
@@ -209,7 +207,7 @@ parse_flags() {
209207

210208
# Location where intermediate files will be created.
211209
TIMESTAMP=`date +%Y-%m-%d`
212-
TMP_DIR=(${MKTEMP_DT} ${LANG_CODE}-${TIMESTAMP}.XXX )
210+
TMP_DIR=$(${MKTEMP_DT} ${LANG_CODE}-${TIMESTAMP}.XXX)
213211
TRAINING_DIR=${TMP_DIR}
214212
# Location of log file for the whole run.
215213
LOG_FILE=${TRAINING_DIR}/tesstrain.log

0 commit comments

Comments
 (0)