| 1 | #!/bin/sh |
| 2 | # Build and relaunch the app. Ships the RELEASE binary — the timeline is |
| 3 | # measurably 4× slower under -Onone, so the app people actually run must be |
| 4 | # optimized. Pass --debug to ship the debug build (e.g. when chasing a crash |
| 5 | # with full assertions/symbols). |
| 6 | set -e |
| 7 | cd "$(dirname "$0")" |
| 8 | CONF=release |
| 9 | [ "$1" = "--debug" ] && CONF=debug |
| 10 | swift build -c "$CONF" |
| 11 | pkill -x Sequencer 2>/dev/null || true |
| 12 | # The app terminates its ffmpeg children on SIGTERM, but sweep any strays from |
| 13 | # older builds anyway — orphaned encoders exhaust the shared VideoToolbox |
| 14 | # session pool and the next launch's players silently render black. |
| 15 | sleep 1 |
| 16 | pkill -9 -f "Library/Caches/Sequencer" 2>/dev/null || true |
| 17 | cp ".build/$CONF/Sequencer" Sequencer.app/Contents/MacOS/Sequencer |
| 18 | codesign --force --deep --sign "Sequencer Dev" Sequencer.app |
| 19 | open Sequencer.app |