@echo off
setlocal
cd /d "%~dp0"
title coco 运行依赖安装

echo.
echo ==========================================
echo coco 运行依赖安装
echo ==========================================
echo 正在安装，请等待。安装完成后 coco 会自动启动。
echo.

powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0core\setup.ps1"
set "exitCode=%ERRORLEVEL%"

if not "%exitCode%"=="0" (
    echo.
    echo 依赖安装失败，请查看 bootstrap.log。
    timeout /t 8 /nobreak >nul
)

exit /b %exitCode%
