From 591d231bd7ada3286db255a7e87c73f51628f045 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 11 Jan 2019 08:59:58 -0500 Subject: [PATCH] Have the output directory of the install be consistent Former-commit-id: 90e2874ba7636fd06402d39b1892a3eebc5e00c0 [formerly 9530f9420146c55387b2f55a95fa6231afb2bc9b] Former-commit-id: 684809071cd7110c33f2cce974b9b30be0a1c1ca Former-commit-id: df2bc0271b2215c17661349fef81171d90444f46 --- installer_mac/make_installer.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/installer_mac/make_installer.sh b/installer_mac/make_installer.sh index 32b875bd422..da326fb26b7 100755 --- a/installer_mac/make_installer.sh +++ b/installer_mac/make_installer.sh @@ -35,9 +35,11 @@ RSRCS="../resources/data" OUTPUT_BASE_FILENAME="Surge-$VERSION-Setup" +TARGET_DIR="installer"; + build_flavor() { - TMPDIR=installer/tmp-pkg + TMPDIR=${TARGET_DIR}/tmp-pkg flavor=$1 flavorprod=$2 ident=$3 @@ -52,7 +54,7 @@ build_flavor() # The defaults only work if a component is a sole entry in a staging directory though, so synthesize that # by moving the product to a tmp dir - mkdir $TMPDIR + mkdir -p $TMPDIR mv $PRODUCTS/$flavorprod $TMPDIR pkgbuild --root $TMPDIR --identifier $ident --version $VERSION --install-location $loc Surge_${flavor}.pkg || exit 1 @@ -142,19 +144,19 @@ XMLEND # build installation bundle -if [[ ! -d installer ]]; then - mkdir installer +if [[ ! -d ${TARGET_DIR} ]]; then + mkdir ${TARGET_DIR} fi -productbuild --distribution distribution.xml --package-path "./" --resources Resources "installer/$OUTPUT_BASE_FILENAME.pkg" +productbuild --distribution distribution.xml --package-path "./" --resources Resources "${TARGET_DIR}/$OUTPUT_BASE_FILENAME.pkg" # create a DMG if required if [[ $2 == "--dmg" ]]; then - if [[ -f "$OUTPUT_BASE_FILENAME.dmg" ]]; then - rm "$OUTPUT_BASE_FILENAME.dmg" + if [[ -f "${TARGET_DIR}/$OUTPUT_BASE_FILENAME.dmg" ]]; then + rm "${TARGET_DIR}/$OUTPUT_BASE_FILENAME.dmg" fi - hdiutil create /tmp/tmp.dmg -ov -volname "$OUTPUT_BASE_FILENAME" -fs HFS+ -srcfolder "./installer/" - hdiutil convert /tmp/tmp.dmg -format UDZO -o "$OUTPUT_BASE_FILENAME.dmg" + hdiutil create /tmp/tmp.dmg -ov -volname "$OUTPUT_BASE_FILENAME" -fs HFS+ -srcfolder "./${TARGET_DIR}/" + hdiutil convert /tmp/tmp.dmg -format UDZO -o "${TARGET_DIR}/$OUTPUT_BASE_FILENAME.dmg" fi # clean up