Files
yidaima_tools/bat/run_install_front.bat
2026-04-10 14:37:23 +08:00

25 lines
606 B
Batchfile

@echo off
:: 设置编码为 UTF-8
chcp 65001 >nul
:: 1. 增加 /d 参数切换盘符,并检查路径是否存在
cd /d D:\code\front\client_code
if %errorlevel% neq 0 (
echo [错误] 无法找到目录: D:\code\front\client_code
pause
exit /b
)
echo 当前目录: %cd%
:: 2. 判断 node_modules 是否存在
if not exist "node_modules\" (
echo 未检测到 node_modules 目录,开始安装依赖...
:: 使用 call 确保 npm 执行完后脚本继续运行
call npm install
) else (
echo 检测到 node_modules 目录,跳过依赖安装。
)
echo.
echo 执行完毕!