Skip to content

Commit

Permalink
fix for mktemp bug on MAC OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoGOT committed Apr 10, 2018
1 parent 7a5033d commit 3917a19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion training/tesstrain_utils.sh
Expand Up @@ -192,7 +192,11 @@ parse_flags() {

# Function initializes font config with a unique font cache dir.
initialize_fontconfig() {
export FONT_CONFIG_CACHE=$(mktemp -d --tmpdir font_tmp.XXXXXXXXXX)
if [[ "$OSTYPE" == "darwin"* ]]; then
export FONT_CONFIG_CACHE=$(mktemp -d -t font_tmp.XXXXXXXXXX)
else
export FONT_CONFIG_CACHE=$(mktemp -d --tmpdir font_tmp.XXXXXXXXXX)
fi
local sample_path=${FONT_CONFIG_CACHE}/sample_text.txt
echo "Text" >${sample_path}
run_command text2image --fonts_dir=${FONTS_DIR} \
Expand Down

0 comments on commit 3917a19

Please sign in to comment.