-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
38 lines (34 loc) · 1 KB
/
start.bat
File metadata and controls
38 lines (34 loc) · 1 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
@echo off
setlocal
IF "%1"=="prod" (
echo Starting in production mode...
cd frontend
call npm run build
start /B npm run start
cd ..\backend\byteport
go run main.go
) ELSE IF "%1"=="dev" (
echo Starting in development mode...
REM Check if tmux is available (for WSL users)
where tmux >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
REM WSL/tmux version
tmux new-session -d -s devsession
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "cd frontend && npm run dev -- --port 5173" C-m
tmux select-pane -t 1
tmux send-keys "cd backend/byteport && air" C-m
tmux attach-session -t devsession
) ELSE (
REM Pure Windows version using multiple command prompts
echo Starting frontend...
start cmd /k "cd frontend && npm run dev -- --port 5173"
echo Starting backend...
start cmd /k "cd backend\byteport && air"
)
) ELSE (
echo Usage: %0 {dev^|prod}
exit /b 1
)
endlocal