Files
soul-yongping/soul-api/switch-env.bat
2026-03-07 22:58:43 +08:00

47 lines
951 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
cd /d "%~dp0"
REM air(make dev) 默认用 .env.development本 bat 用于切到正式环境后 go run / 直接运行
echo.
echo Soul API - 环境切换
echo -------------------
echo air 已默认用开发配置,本工具用于切换 .env 供 go run 等使用
echo.
echo 1. 正式环境 (.env.production) - 切到正式配置
echo 2. 开发环境 (.env.development)
echo 3. 退出
echo.
set /p choice=请选择 (1/2/3):
if "%choice%"=="1" goto prod
if "%choice%"=="2" goto dev
if "%choice%"=="3" goto end
echo 无效选择
goto end
:prod
if not exist .env.production (
echo 错误: .env.production 不存在
goto end
)
copy /y .env.production .env >nul
echo.
echo 已切换到: 正式环境
goto end
:dev
if not exist .env.development (
echo 错误: .env.development 不存在
goto end
)
copy /y .env.development .env >nul
echo.
echo 已切换到: 开发环境
goto end
:end
echo.
pause