Changes to make the preview script also run on Darwin
authorQuentin Smith <quentin@mit.edu>
Sat, 6 Mar 2010 05:14:00 +0000 (00:14 -0500)
committerQuentin Smith <quentin@mit.edu>
Sat, 6 Mar 2010 05:14:00 +0000 (00:14 -0500)
generate-preview.sh

index a50be6767827ee3fb8446a5ea050ac1c066ab7ee..282ac67e5b7563a542c6922e832d15fc12be996d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-set -e
+set -e -x
 
 export IKIWIKI_PREVIEW_OUTPUT="$1"
 if [ -z "$IKIWIKI_PREVIEW_OUTPUT" ]; then
@@ -13,16 +13,16 @@ srcdir=$(pwd)
 if [ -n "$2" ]; then
     tmpoutdir="$2"
 else
-    tmpdir=`mktemp -d`
-    tmpoutdir=`mktemp -d`
+    tmpdir=`mktemp -d -t tmp.XXXXXXXXXX`
+    tmpoutdir=`mktemp -d -t tmp.XXXXXXXXXX`
     echo "Building ikiwiki source in $tmpdir"
     echo "Building ikiwiki into $tmpoutdir"
     trap 'rm -rf "$tmpdir"; rm -rf "$tmpoutdir"' 0
     cd "$tmpdir"
     (cd "$srcdir/ikiwiki" && tar c .) | (cd "$tmpdir" && tar x)
-    ./Makefile.PL INSTALL_BASE="$tmpoutdir" PREFIX=
+    perl ./Makefile.PL INSTALL_BASE="$tmpoutdir" PREFIX=
     make install --old-file=docwiki
 fi
 cd "$srcdir"
 export IKIWIKI_SHARE="$tmpoutdir/share/ikiwiki"
-"$tmpoutdir"/bin/ikiwiki --setup "$srcdir"/ikiwiki.setup
+perl "$tmpoutdir"/bin/ikiwiki --setup "$srcdir"/ikiwiki.setup