Skip to content

Instantly share code, notes, and snippets.

@lukespragg
Last active December 12, 2015 04:48
Show Gist options
  • Save lukespragg/4716516 to your computer and use it in GitHub Desktop.
Save lukespragg/4716516 to your computer and use it in GitHub Desktop.
Spoutcraft .dmg generation
# Make .dmg for Mac
DMG_NAME=Spoutcraft
VOLUME_LABEL=Spoutcraft
du_output=`du -sk $WORKSPACE/$ARTIFACT_ID-$VERSION.app 2>&1`
DIR_SIZE=`echo $du_output | cut -f1 -d" "`
DIR_SIZE=`expr $DIR_SIZE + 100`
dd if=/dev/zero of=$DMG_NAME bs=1024 count=$DIR_SIZE
mkfs.hfsplus -v "$VOLUME_LABEL" $DMG_NAME
mount -o loop -t hfsplus ./$DMG_NAME /mnt/tmp/
cp -r $DIR_PATH/* /mnt/tmp
umount /mnt/tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment