You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.1 KiB
76 lines
2.1 KiB
@echo off |
|
chcp 65001 >nul |
|
setlocal enabledelayedexpansion |
|
|
|
echo ======================================== |
|
echo GoFaster 开发环境快速启动 |
|
echo ======================================== |
|
echo. |
|
|
|
REM 检查 PowerShell 执行策略 |
|
powershell -Command "Get-ExecutionPolicy" >nul 2>&1 |
|
if errorlevel 1 ( |
|
echo [INFO] 正在设置 PowerShell 执行策略... |
|
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force" |
|
) |
|
|
|
echo. |
|
echo 启动选项: |
|
echo 1. 全栈启动 (前后端) |
|
echo 2. 全栈启动 (调试模式) |
|
echo 3. 全栈启动 (监听模式) |
|
echo 4. 仅启动后端 |
|
echo 5. 仅启动前端 |
|
echo 6. 退出 |
|
echo. |
|
|
|
set /p choice="请选择 (1-6): " |
|
|
|
if "%choice%"=="1" ( |
|
echo [INFO] 启动全栈开发环境... |
|
powershell -ExecutionPolicy Bypass -File dev-full.ps1 |
|
if errorlevel 1 ( |
|
echo [ERROR] 启动失败,请检查错误信息 |
|
pause |
|
) |
|
) else if "%choice%"=="2" ( |
|
echo [INFO] 启动全栈开发环境 (调试模式)... |
|
powershell -ExecutionPolicy Bypass -File dev-full.ps1 -Debug |
|
if errorlevel 1 ( |
|
echo [ERROR] 启动失败,请检查错误信息 |
|
pause |
|
) |
|
) else if "%choice%"=="3" ( |
|
echo [INFO] 启动全栈开发环境 (监听模式)... |
|
powershell -ExecutionPolicy Bypass -File dev-full.ps1 -Watch |
|
if errorlevel 1 ( |
|
echo [ERROR] 启动失败,请检查错误信息 |
|
pause |
|
) |
|
) else if "%choice%"=="4" ( |
|
echo [INFO] 仅启动后端... |
|
powershell -ExecutionPolicy Bypass -File dev-full.ps1 -BackendOnly |
|
if errorlevel 1 ( |
|
echo [ERROR] 启动失败,请检查错误信息 |
|
pause |
|
) |
|
) else if "%choice%"=="5" ( |
|
echo [INFO] 仅启动前端... |
|
powershell -ExecutionPolicy Bypass -File dev-full.ps1 -FrontendOnly |
|
if errorlevel 1 ( |
|
echo [ERROR] 启动失败,请检查错误信息 |
|
pause |
|
) |
|
) else if "%choice%"=="6" ( |
|
echo [INFO] 再见! |
|
pause |
|
exit /b 0 |
|
) else ( |
|
echo [ERROR] 无效选择,请重新运行脚本 |
|
pause |
|
exit /b 1 |
|
) |
|
|
|
echo. |
|
echo 按任意键退出... |
|
pause >nul
|
|
|