From 080222f121d600f9dd716373ca66632dfbfaa476 Mon Sep 17 00:00:00 2001 From: rzuasti Date: Thu, 4 Jun 2026 09:05:44 -0400 Subject: [PATCH] Rename frontend run scripts and add Android emulator runner Rename android-emulator.sh to run_android.sh and run.sh to run_web.sh, add run_android_emulator.sh to launch the app on the emulator, and update CLAUDE.md commands accordingly. Co-Authored-By: Claude Opus 4.8 --- CLAUDE.md | 4 ++- .../{android-emulator.sh => run_android.sh} | 0 frontend/run_android_emulator.sh | 29 +++++++++++++++++++ frontend/{run.sh => run_web.sh} | 0 4 files changed, 32 insertions(+), 1 deletion(-) rename frontend/{android-emulator.sh => run_android.sh} (100%) create mode 100755 frontend/run_android_emulator.sh rename frontend/{run.sh => run_web.sh} (100%) diff --git a/CLAUDE.md b/CLAUDE.md index b4a2975..a740691 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -21,7 +21,9 @@ For Flutter/Dart code: - `cd backend && ./build.sh` from the `backend/` folder - Build the backend - `cd backend && ./run.sh` from the `backend/` folder - Run the backend -- `cd frontend && ./run.sh` from the `frontend/` folder - Run the front-end for the web +- `cd frontend && ./run_web.sh` from the `frontend/` folder - Run the front-end for the web +- `cd frontend && ./run_android.sh` from the `frontend/` folder - Boot the Android emulator +- `cd frontend && ./run_android_emulator.sh` from the `frontend/` folder - Run the front-end on the Android emulator - `cd backend && ./run_tests.sh` - Run the backend tests - `cd frontend && ./run_tests.sh` - Run the front-end tests - `cd backend && ./lint.sh` - Run the clippy linter for Rust code diff --git a/frontend/android-emulator.sh b/frontend/run_android.sh similarity index 100% rename from frontend/android-emulator.sh rename to frontend/run_android.sh diff --git a/frontend/run_android_emulator.sh b/frontend/run_android_emulator.sh new file mode 100755 index 0000000..bc8d5d7 --- /dev/null +++ b/frontend/run_android_emulator.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# Run the OOTT front-end on the Android emulator. +# +# Boots the emulator first (via run_android.sh) if it isn't already running, +# then launches the Flutter app on it. Any extra arguments are forwarded to +# `flutter run`. +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if ! command -v flutter >/dev/null 2>&1; then + echo "error: 'flutter' not found on PATH." >&2 + echo " Enter the dev shell first (e.g. 'nix develop')." >&2 + exit 1 +fi + +# Boot the emulator in the background if no Android device is connected yet. +if ! flutter devices 2>/dev/null | grep -qi "android"; then + echo "No Android device detected, booting the emulator..." + "$SCRIPT_DIR/run_android.sh" -no-snapshot-save & + + echo "Waiting for the emulator to come online..." + until flutter devices 2>/dev/null | grep -qi "android"; do + sleep 2 + done +fi + +exec flutter run -d android "$@" diff --git a/frontend/run.sh b/frontend/run_web.sh similarity index 100% rename from frontend/run.sh rename to frontend/run_web.sh