#!/usr/bin/env bash # Prepare the Tauri bundle inputs: build the web cockpit, copy it in as a # resource, and compile the Node bridge into Bun single-file sidecars named with # the Tauri target triples. Run from the repo root. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" export PATH="$HOME/.bun/bin:$PATH" echo "==> building web cockpit" ( cd web && npm run build >/dev/null ) echo "==> copying cockpit into desktop resources" rm -rf desktop/src-tauri/resources/web mkdir -p desktop/src-tauri/resources/web cp -R web/dist/. desktop/src-tauri/resources/web/ echo "==> copying FlyWithLua companion scripts into desktop resources" rm -rf desktop/src-tauri/resources/plugins mkdir -p desktop/src-tauri/resources/plugins cp plugins/*.lua desktop/src-tauri/resources/plugins/ echo "==> compiling bridge sidecars (Bun)" mkdir -p desktop/src-tauri/binaries bun build --compile --target=bun-darwin-arm64 server/bridge.js \ --outfile desktop/src-tauri/binaries/xpbridge-aarch64-apple-darwin bun build --compile --target=bun-linux-x64-baseline server/bridge.js \ --outfile desktop/src-tauri/binaries/xpbridge-x86_64-unknown-linux-gnu chmod +x desktop/src-tauri/binaries/xpbridge-* echo "==> done" ls -lh desktop/src-tauri/binaries/