#!/usr/bin/env bash # # Build, install to /Applications, relaunch. # # The standing workflow for seeing a change: this replaces the installed app # rather than producing a disk image, because nothing here is being distributed. set -euo pipefail cd "$(dirname "$0")/.." APP="Work.app" BUILT="src-tauri/target/release/bundle/macos/$APP" DEST="/Applications/$APP" echo "==> building" npm run tauri build -- --bundles app echo "==> quitting the running copy" osascript -e 'quit app "Work"' >/dev/null 2>&1 || true # A hung window would otherwise keep the bundle busy while it is replaced. pkill -x Work >/dev/null 2>&1 || true for _ in 1 2 3 4 5 6 7 8 9 10; do pgrep -x Work >/dev/null || break sleep 0.3 done echo "==> installing to $DEST" rm -rf "$DEST" cp -R "$BUILT" "$DEST" echo "==> launching" open "$DEST" echo "==> done"