2006-04-17

Revised my snapshot script to build a .dmg to go with the source .tar.gz:

#! /bin/bash
# Make a snapshot of an XCode project's contents, excluding the large but reconstructible
# files in its build subdirectory, and save it as a compressed, timestamped archive.

appname=${1%/}
archtime=`/bin/date +"%Y-%m%d-%H%M"`
/usr/bin/tar zcf "$appname-$archtime.tar.gz" --exclude "$appname/build" "$appname"

# Make a distributable disk image of the application bundle.

if [ "$2" != "" ] ; then
	tempdir=$appname-$archtime
	/bin/mkdir "$tempdir"
	/bin/mv "$appname/build/$appname.app" "$tempdir"
	/usr/bin/hdiutil create -srcfolder "$tempdir" "$tempdir.dmg"
	/bin/mv "$tempdir/$appname.app" "$appname/build"
	/bin/rm -r "$tempdir"
fi