Skip to content

Commit

Permalink
MAC Build: verbose packaging process
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ext committed Dec 3, 2018
1 parent 3662eff commit d892ec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 9 additions & 4 deletions scripts/prepare_package_ui_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
Expand All @@ -48,4 +52,5 @@ echo '
end tell
' | osascript || exit 1

echo "Syncing..."
sync || exit 1

0 comments on commit d892ec7

Please sign in to comment.