@echo off
chcp 65001 >nul
title Update Node.js Dependencies List

cd /d "%~dp0\..\.."

REM Check if node_modules exists
if not exist "node_modules" (
    echo [ERROR] node_modules not found
    echo Please run npm install first to install dependencies.
    echo.
    pause
    exit /b 1
)

REM Run Node.js script to compare and update dependencies.txt
node "%~dp0update-nodejs-dependencies.js"

if errorlevel 1 (
    echo.
    echo [ERROR] Update failed
    echo.
    pause
    exit /b 1
) else (
    echo.
    echo [OK] Update completed
    echo.
    pause
)
