Alternative creation of TMPDIR in Windows.

Users of portableGit in Windows do not have mktemp.
TMPDIR ended up empty and compiler.js was created at /.
Good thing is "rm -rf " trap failed with empty arguments
and it did not remove everything.
This commit is contained in:
Herbert Vojčík 2012-12-10 19:07:05 +01:00
parent 4f40a30718
commit 4b35f04f9a
1 changed files with 2 additions and 1 deletions

View File

@ -216,7 +216,8 @@ done
LIBS="$TOBASE $TOLOAD"
# Get a unique tempdir and make it get auto removed on exit
TMPDIR=`mktemp -d amberc.XXXXXX`
TMPDIR=`mktemp -d amberc.XXXXXX 2>>/dev/null` ||\
TMPDIR=/tmp/amberc.$$.`date +%s` && mkdir -p $TMPDIR
trap "rm -rf $TMPDIR" EXIT