diff --git a/.travis.yml b/.travis.yml index 68f598ecf..cba2b335c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,7 @@ after_success: hdiutil create -srcfolder image -volname "${VOL_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$DMG_TMP_FILE" && export DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP_FILE}" | egrep '^/dev/' | sed 1q | awk '{print $1}') && sleep 2 && - ../scripts/prepare_package_ui_macos.sh "Cutter" "../src/macos/cutter_mac_app.png" "${VOL_NAME}" && + ../scripts/prepare_package_ui_macos.sh "Cutter" "${PWD}/../src/macos/cutter_mac_app.png" "${VOL_NAME}" && hdiutil detach "${DEVICE}" && hdiutil convert "${DMG_TMP_FILE}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FILE}" && export FILE_TO_UPLOAD="$DMG_FILE" diff --git a/scripts/prepare_package_ui_macos.sh b/scripts/prepare_package_ui_macos.sh index 4f8a4003b..8ff01f2b6 100755 --- a/scripts/prepare_package_ui_macos.sh +++ b/scripts/prepare_package_ui_macos.sh @@ -14,13 +14,17 @@ if [[ ! -f ${DMG_BACKGROUND_IMG} ]]; then exit 1 fi -pushd "/Volumes/${VOL_NAME}" || exit 1 +echo "Adding link to '/Applications'..." +pushd /Volumes/"${VOL_NAME}" || exit 1 ln -s /Applications " " || exit 1 popd || exit 1 -mkdir /Volumes/${VOL_NAME}/.background || exit 1 +echo "Package background set up..." +mkdir /Volumes/"${VOL_NAME}"/.background || exit 1 -cp "${DMG_BACKGROUND_IMG}" /Volumes/${VOL_NAME}/.background/ || exit 1 +cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/ || exit 1 + +DMG_BACKGROUND_IMG_BASENAME=$(basename "${DMG_BACKGROUND_IMG}") # tell the Finder to resize the window, set the background, # change the icon size, place the icons in the right position, etc. @@ -35,7 +39,7 @@ echo ' set viewOptions to the icon view options of container window set arrangement of viewOptions to not arranged set icon size of viewOptions to 122 - set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG}'" + set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG_BASENAME}'" set position of item "'${APP_NAME}'.app" of container window to {117, 193} set position of item " " of container window to {411, 193} set position of item ".background" of container window to {1000, 1000} @@ -48,4 +52,5 @@ echo ' end tell ' | osascript || exit 1 +echo "Syncing..." sync || exit 1