From 5df21165a58eabb911bf9f4f830de9be56544c52 Mon Sep 17 00:00:00 2001 From: tianmo Date: Sat, 5 Sep 2026 22:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9A=82=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 停止Spine连接器-Windows.bat | 6 ++++-- 启动Spine连接器-Windows.bat | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/停止Spine连接器-Windows.bat b/停止Spine连接器-Windows.bat index f6cd0ec..38c2fa6 100644 --- a/停止Spine连接器-Windows.bat +++ b/停止Spine连接器-Windows.bat @@ -21,18 +21,20 @@ set "STOP_RESULT=%ERRORLEVEL%" if "%STOP_RESULT%"=="0" ( del /q "%PID_FILE%" >nul 2>&1 echo Spine粒子连接器已停止。 + timeout /t 1 /nobreak >nul exit /b 0 ) if "%STOP_RESULT%"=="2" ( del /q "%PID_FILE%" >nul 2>&1 echo Spine粒子连接器已经停止。 + timeout /t 1 /nobreak >nul exit /b 0 ) if "%STOP_RESULT%"=="3" ( echo 27843 端口对应的进程不属于当前项目,为避免误关,本次未执行停止。 - pause + timeout /t 1 /nobreak >nul exit /b 1 ) echo 停止 Spine粒子连接器失败,请检查 PowerShell 权限或手动结束对应进程。 -pause +timeout /t 1 /nobreak >nul exit /b 1 diff --git a/启动Spine连接器-Windows.bat b/启动Spine连接器-Windows.bat index b3f6cb3..b4b0508 100644 --- a/启动Spine连接器-Windows.bat +++ b/启动Spine连接器-Windows.bat @@ -14,7 +14,7 @@ set "SPINE_EXECUTABLE=C:\Spine\Spine.com" if not exist "%RUN_DIR%" mkdir "%RUN_DIR%" if not exist "%CONNECTOR_ENTRY%" ( echo 未找到连接器入口:%CONNECTOR_ENTRY% - pause + timeout /t 1 /nobreak >nul exit /b 1 ) cd /d "%PROJECT_DIR%" @@ -31,6 +31,7 @@ if defined CONNECTOR_PID ( powershell -NoProfile -Command "try{$response=Invoke-WebRequest -UseBasicParsing -Uri $env:HEALTH_URL -TimeoutSec 2; if($response.StatusCode -eq 200){exit 0}}catch{}; exit 1" if not errorlevel 1 ( echo Spine粒子连接器已经在运行。 + timeout /t 1 /nobreak >nul exit /b 0 ) powershell -NoProfile -Command "Stop-Process -Id $env:CONNECTOR_PID -Force -ErrorAction SilentlyContinue" @@ -51,22 +52,23 @@ if "%PORT_RESULT%"=="0" ( powershell -NoProfile -Command "try{$response=Invoke-WebRequest -UseBasicParsing -Uri $env:HEALTH_URL -TimeoutSec 2; if($response.StatusCode -eq 200){exit 0}}catch{}; exit 1" if not errorlevel 1 ( echo Spine粒子连接器已经在运行。 + timeout /t 1 /nobreak >nul exit /b 0 ) echo 已发现本项目的连接器进程,但健康检查失败。请先运行停止脚本后再试。 - pause + timeout /t 1 /nobreak >nul exit /b 1 ) if "%PORT_RESULT%"=="3" ( echo 27843 端口已被其他程序占用,无法启动 Spine粒子连接器。 - pause + timeout /t 1 /nobreak >nul exit /b 1 ) where node >nul 2>&1 if errorlevel 1 ( echo 未找到 Node.js,请先安装 Node.js 18 或更高版本。 - pause + timeout /t 1 /nobreak >nul exit /b 1 ) @@ -79,7 +81,7 @@ powershell -NoProfile -Command ^ if errorlevel 1 ( echo 连接器进程启动失败。 - pause + timeout /t 1 /nobreak >nul exit /b 1 ) @@ -96,6 +98,7 @@ powershell -NoProfile -Command ^ set "START_RESULT=%ERRORLEVEL%" if "%START_RESULT%"=="0" ( echo Spine粒子连接器启动成功,可以回到网页直接导出 .spine。 + timeout /t 1 /nobreak >nul exit /b 0 ) @@ -112,5 +115,5 @@ if exist "%OUT_LOG%" ( ) powershell -NoProfile -Command "Stop-Process -Id $env:CONNECTOR_PID -Force -ErrorAction SilentlyContinue" del /q "%PID_FILE%" >nul 2>&1 -pause +timeout /t 1 /nobreak >nul exit /b 1