merge-forward: Fix for OS X mktemp
authorTim Otten <totten@civicrm.org>
Tue, 23 Apr 2013 22:11:23 +0000 (15:11 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 23 Apr 2013 22:11:23 +0000 (15:11 -0700)
tools/scripts/merge-forward

index f7939fd79d0a5c93b5f5f60bb2c59a88718bda4f..99329a3452b62ff1c17dfa0b6a3ed700cd9dbd33 100755 (executable)
@@ -19,7 +19,10 @@ if [ -z "$RELPATH" -o  -z "$REMOTE" -o  -z "$MAINTBRANCH" -o  -z "$DEVBRANCH" ]
 fi
 
 pushd "$RELPATH" >> /dev/null
-  TMPFILE=$(mktemp)
+  ## OS X: mktemp requires "-t prefix" argument
+  ## GNU: mktemp accepts optional -t pattern" argument
+  ## The string "merge-forward-XXXXXX" works as a prefix or pattern
+  TMPFILE=$(mktemp -t merge-forward-XXXXXX)
 
   set -x
   git fetch $REMOTE