添加暂停

This commit is contained in:
tianmo
2026-09-05 22:32:12 +08:00
parent 1d145312cf
commit 5df21165a5
2 changed files with 13 additions and 8 deletions
+4 -2
View File
@@ -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
+9 -6
View File
@@ -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