From b3ace06e6de2123a54bc2a6843d19120a573b1f9 Mon Sep 17 00:00:00 2001 From: danemadsen Date: Thu, 4 Jul 2024 22:30:49 +1000 Subject: [PATCH] dmg allocation --- .github/scripts/create_dmg.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/create_dmg.sh b/.github/scripts/create_dmg.sh index 7444b27c..4621319b 100755 --- a/.github/scripts/create_dmg.sh +++ b/.github/scripts/create_dmg.sh @@ -8,16 +8,18 @@ DMG_TEMPLATE="./.github/assets/maid.dmg" DMG_OUTPUT="./dmg/${APP_NAME}.dmg" TMP_MOUNT="/tmp/Maid" TMP_DMG="/tmp/${APP_NAME}_tmp.dmg" +DMG_SIZE=1g # Create the dmg directory if it does not exist mkdir -p "$(dirname ${DMG_OUTPUT})" mkdir -p ${TMP_MOUNT} -# Convert the template DMG to a writable DMG +# Convert the template DMG to a writable DMG with increased size hdiutil convert ${DMG_TEMPLATE} -format UDRW -o ${TMP_DMG} +hdiutil resize -size ${DMG_SIZE} ${TMP_DMG}.dmg # Mount the writable DMG -hdiutil attach ${TMP_DMG} -mountpoint ${TMP_MOUNT} -nobrowse -noverify -noautoopen +hdiutil attach ${TMP_DMG}.dmg -mountpoint ${TMP_MOUNT} -nobrowse -noverify -noautoopen # Replace the TARGET file with maid.app rm -rf "${TMP_MOUNT}/TARGET" @@ -27,9 +29,9 @@ cp -R "${APP_DIR}" "${TMP_MOUNT}/maid.app" hdiutil detach ${TMP_MOUNT} # Convert the writable DMG to a compressed DMG -hdiutil convert ${TMP_DMG} -format UDZO -o ${DMG_OUTPUT} +hdiutil convert ${TMP_DMG}.dmg -format UDZO -o ${DMG_OUTPUT} # Clean up the temporary writable DMG -rm ${TMP_DMG} +rm ${TMP_DMG}.dmg echo "DMG creation completed successfully!"