fabacab / git-archive-all.sh

A bash shell script wrapper for git-archive that archives a git superproject and its submodules, if it has any.
214 stars 86 forks source link

TMPDIR overlaps on OS X #24

Open aburks opened 9 years ago

aburks commented 9 years ago

When creating TMPDIR on OS X it doesn't seem to be unique on each run of the script, especially if using the "zip" type. The fix for me was to initialize TMPDIR as follows:

TMPDIR=`mktemp -d 2>/dev/null || mktemp -d -t '$PROGRAM.XXXXXX'`

This fix is safe for both Linux and OS X.

aburks commented 9 years ago

This script is awesome, by the way: thanks for publishing it!

dmick commented 7 years ago

discovered this today too

dmick commented 7 years ago

a perhaps-more-concise fix suggested by http://stackoverflow.com/questions/31396985/why-is-mktemp-on-os-x-broken-with-a-command-that-worked-on-linux:

TMPDIR=`mktemp -d "${TMPDIR:-/tmp}/$PROGRAM.XXXXXX"`