main
anastasia Premiere Pro Bridge 0.1.0: Rust bridge, UXP plugin, CEP helper, skills, macOS manifest 32fb583 10d ago
#!/usr/bin/env bash
# Dev loop: ship this source tree to the desktop over adom-bridge, build it there with
# cargo, and (re)start a standalone test server on a scratch port.
#   scripts/dev-sync.sh            # build + restart test server on :47911
#   scripts/dev-sync.sh --no-run   # build only
set -euo pipefail
cd "$(dirname "$0")/.."
PORT="${PB_TEST_PORT:-47911}"
TMP="${TMPDIR:-/tmp}"
TGZ="$TMP/pb-src.tgz"
tar czf "$TGZ" -C .. premiere-bridge/Cargo.toml premiere-bridge/bridge.json premiere-bridge/launcher.py premiere-bridge/src premiere-bridge/plugin
adom-bridge send_files "{\"filePaths\":[\"$TGZ\"],\"reason\":\"premiere-bridge dev sync\"}" >/dev/null
RUN=""
if [[ "${1:-}" != "--no-run" ]]; then
  RUN="pkill -f 'premiere-bridge --port $PORT' || true; (nohup ./target/release/premiere-bridge --port $PORT > /tmp/pb-test.log 2>&1 &); sleep 1; curl -s localhost:$PORT/health"
fi
CMD="mkdir -p ~/adom-dev && cd ~/adom-dev && tar xzf ~/Downloads/pb-src.tgz && rm ~/Downloads/pb-src.tgz && cd premiere-bridge && ~/.cargo/bin/cargo build --release 2>&1 | grep -E '^(error|warning)|^ +-->|Finished|could not compile' ; $RUN"
python3 - "$CMD" <<'EOF' | adom-bridge shell_execute "$(cat)" | python3 -c 'import json,sys; d=json.load(sys.stdin); print(d.get("stdout","")); print(d.get("stderr",""))'
import json, sys
print(json.dumps({"command": sys.argv[1], "reason": "Build and restart the Premiere bridge dev server", "timeoutSeconds": 580}))
EOF