-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.bat
More file actions
71 lines (60 loc) · 1.71 KB
/
Copy pathstart.bat
File metadata and controls
71 lines (60 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@echo off
chcp 65001 >nul 2>&1
setlocal EnableDelayedExpansion
title Shogun - The Tenshu
:: Navigate to script directory (handles shortcut launches)
cd /d "%~dp0"
echo.
echo SHOGUN - Starting the Tenshu...
echo.
:: Check if venv exists (support both "venv" and ".venv" names)
set "VENV_DIR="
if exist "venv\Scripts\activate.bat" (
set "VENV_DIR=venv"
)
if exist ".venv\Scripts\activate.bat" (
set "VENV_DIR=.venv"
)
if "%VENV_DIR%"=="" (
echo ERROR: Virtual environment not found.
echo Looked for: venv\ and .venv\
echo Please run install.bat first.
echo.
echo Press any key to close...
pause >nul
exit /b 1
)
:: Activate venv
echo Using virtual environment: %VENV_DIR%
call %VENV_DIR%\Scripts\activate.bat
:: Build frontend on every launch so the served UI always matches this codebase.
:: This prevents stale laptop builds from hiding newly-added tabs or panels.
echo Building frontend assets...
cd frontend
call npm run build --silent
if errorlevel 1 (
cd ..
echo.
echo ERROR: Frontend build failed.
echo Please run Shogun-Repair-Update.bat, then start Shogun again.
echo.
echo Press any key to close...
pause >nul
exit /b 1
)
cd ..
echo Frontend assets ready.
echo Shogun is starting at http://localhost:8000
echo Your browser will open automatically.
echo.
echo Press Ctrl+C to stop the server.
echo.
:: The Python server opens the browser as soon as it is ready.
set "SHOGUN_BROWSER_URL=http://localhost:8000"
:: Start the server (blocking; keeps the window open)
python -m shogun
:: If the server exits, keep the window open so the user can see errors
echo.
echo Shogun has stopped.
echo Press any key to close this window.
pause >nul