SPB Git

Repository Public

package.sh 1.6 KB 30 lines shellscript

1#!/bin/bash2# ORIX Docs3# File: Scripts/package.sh4# Description: Builds the distribution disk image from dist/ORIX Docs.app: application, Applications shortcut, ORIX background artwork5#              with drag-to-install instructions. Usage: Scripts/package.sh <output.dmg>6#7# Author: Simon-Pierre Boucher8# Contact: contact@spboucher.ai9set -euo pipefail10cd "$(dirname "$0")/.."11DMG="${1:?usage: package.sh <output.dmg>}"12APP="dist/ORIX Docs.app"13[[ -d "$APP" ]] || { echo "ERROR: $APP not found." >&2; exit 1; }14VERSION="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist")"15mkdir -p build/dmg16[[ -f build/dmg/background.png ]] || swift design/dmg/make-background.swift build/dmg >/dev/null17tiffutil -cathidpicheck build/dmg/background.png build/dmg/background@2x.png -out build/dmg/background.tiff >/dev/null 2>&118rm -f "$DMG"19STAGE="$(mktemp -d)"; ditto "$APP" "$STAGE/ORIX Docs.app"20if command -v create-dmg >/dev/null && create-dmg --volname "ORIX Docs $VERSION" --background build/dmg/background.tiff --window-pos 200 140 --window-size 660 448 \21     --icon-size 112 --icon "ORIX Docs.app" 180 200 --app-drop-link 480 200 --hide-extension "ORIX Docs.app" --no-internet-enable "$DMG" "$STAGE" >build/dmg/create-dmg.log 2>&1; then22  echo "Disk image built with artwork: $DMG"23else24  # Finder scripting unavailable: a plain image with the Applications shortcut (no background artwork).25  echo "create-dmg failed (see build/dmg/create-dmg.log); building a plain disk image." >&226  ln -s /Applications "$STAGE/Applications"27  hdiutil create -volname "ORIX Docs $VERSION" -srcfolder "$STAGE" -ov -format UDZO "$DMG" >/dev/null28fi29rm -rf "$STAGE"30
Files main
Menu

Theme