Files
juc500/dist-offline/juc500-offline-update-20260720-144424/scripts/launch_tauri.sh
T
2026-07-21 21:04:25 +09:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# JUC500 Tauri 셸 — USB 케이블 연결 시 Python 백엔드 + GUI 자동 기동
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
export JUC500_ROOT="$ROOT"
# 케이블 자동 실행은 install_autolaunch_* 설치 시 JUC500_CABLE_AUTOLAUNCH=1 로 켬
export JUC500_CABLE_AUTOLAUNCH="${JUC500_CABLE_AUTOLAUNCH:-0}"
export JUC500_USE_TAURI=1
APP_DIR="$ROOT/juc500-app"
if [[ ! -d "$APP_DIR/src-tauri" ]]; then
echo "juc500-app 없음. Tauri 프로젝트를 먼저 빌드하세요." >&2
exit 1
fi
# Release 바이너리 우선, 없으면 dev
BIN=""
for candidate in \
"$APP_DIR/src-tauri/target/release/juc500-app" \
"$APP_DIR/src-tauri/target/debug/juc500-app"; do
if [[ -x "$candidate" ]]; then
BIN="$candidate"
break
fi
done
if [[ -n "$BIN" ]]; then
exec "$BIN"
fi
if ! command -v npm >/dev/null 2>&1; then
echo "npm 없음 — Node.js 설치 후: cd juc500-app && npm install && npm run tauri build" >&2
exit 1
fi
cd "$APP_DIR"
if [[ ! -d node_modules ]]; then
npm install
fi
exec npm run tauri -- dev