From fd5cc1dd6167588e919ff08f15b91d86adf329c8 Mon Sep 17 00:00:00 2001 From: AetherForge Date: Sun, 7 Jun 2026 00:48:24 -0700 Subject: [PATCH] Fix portable USB pack webroot resolution and document LAUNCH flow. Prefer server/webroot in pack-usb (Vite outDir), cd to deck root before starting AetherForge so cwd-based webroot lookup hits usb\webroot, and note pack/LAUNCH steps in tests/README. --- LAUNCH.bat | 3 +++ pack-usb.bat | 6 +++--- tests/README.md | 2 ++ usb/LAUNCH.bat | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/LAUNCH.bat b/LAUNCH.bat index c51c9b0..f205d24 100644 --- a/LAUNCH.bat +++ b/LAUNCH.bat @@ -154,6 +154,9 @@ if exist "%CF_SCRIPT%" ( ) echo. +:: Ensure cwd matches deck root so webroot resolution finds usb\webroot +cd /d "%ROOT%" + :: Open browser after short delay start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:%SERVER_PORT%/'" diff --git a/pack-usb.bat b/pack-usb.bat index ea4e460..6723433 100644 --- a/pack-usb.bat +++ b/pack-usb.bat @@ -104,10 +104,10 @@ echo [2/8] AetherForge.exe ready. :: ---------------------------------------------------------------- echo [3/8] Copying webroot... if exist "%USB%\webroot" rd /s /q "%USB%\webroot" -if exist "%ROOT%\server\web\dist" ( - xcopy /e /i /q "%ROOT%\server\web\dist" "%USB%\webroot" >nul -) else if exist "%ROOT%\server\webroot" ( +if exist "%ROOT%\server\webroot" ( xcopy /e /i /q "%ROOT%\server\webroot" "%USB%\webroot" >nul +) else if exist "%ROOT%\server\web\dist" ( + xcopy /e /i /q "%ROOT%\server\web\dist" "%USB%\webroot" >nul ) else ( echo ERROR: No webroot found. Run npm run build in server\web first. pause diff --git a/tests/README.md b/tests/README.md index a06815f..0db65e2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -14,6 +14,8 @@ Or with PowerShell directly: .\scripts\test-suite.ps1 -ReconOnly ``` +**Portable USB:** `pack-usb.bat` from repo root → copy `usb\` to a drive → `LAUNCH.bat` (opens `http://localhost:8989/`; `/agents` redirects to `/crucible` in the SPA). + ## Phases | Phase | What it runs | Location | diff --git a/usb/LAUNCH.bat b/usb/LAUNCH.bat index c51c9b0..f205d24 100644 --- a/usb/LAUNCH.bat +++ b/usb/LAUNCH.bat @@ -154,6 +154,9 @@ if exist "%CF_SCRIPT%" ( ) echo. +:: Ensure cwd matches deck root so webroot resolution finds usb\webroot +cd /d "%ROOT%" + :: Open browser after short delay start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:%SERVER_PORT%/'"