添加暂停
This commit is contained in:
@@ -21,18 +21,20 @@ set "STOP_RESULT=%ERRORLEVEL%"
|
|||||||
if "%STOP_RESULT%"=="0" (
|
if "%STOP_RESULT%"=="0" (
|
||||||
del /q "%PID_FILE%" >nul 2>&1
|
del /q "%PID_FILE%" >nul 2>&1
|
||||||
echo Spine粒子连接器已停止。
|
echo Spine粒子连接器已停止。
|
||||||
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
if "%STOP_RESULT%"=="2" (
|
if "%STOP_RESULT%"=="2" (
|
||||||
del /q "%PID_FILE%" >nul 2>&1
|
del /q "%PID_FILE%" >nul 2>&1
|
||||||
echo Spine粒子连接器已经停止。
|
echo Spine粒子连接器已经停止。
|
||||||
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
if "%STOP_RESULT%"=="3" (
|
if "%STOP_RESULT%"=="3" (
|
||||||
echo 27843 端口对应的进程不属于当前项目,为避免误关,本次未执行停止。
|
echo 27843 端口对应的进程不属于当前项目,为避免误关,本次未执行停止。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
echo 停止 Spine粒子连接器失败,请检查 PowerShell 权限或手动结束对应进程。
|
echo 停止 Spine粒子连接器失败,请检查 PowerShell 权限或手动结束对应进程。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ set "SPINE_EXECUTABLE=C:\Spine\Spine.com"
|
|||||||
if not exist "%RUN_DIR%" mkdir "%RUN_DIR%"
|
if not exist "%RUN_DIR%" mkdir "%RUN_DIR%"
|
||||||
if not exist "%CONNECTOR_ENTRY%" (
|
if not exist "%CONNECTOR_ENTRY%" (
|
||||||
echo 未找到连接器入口:%CONNECTOR_ENTRY%
|
echo 未找到连接器入口:%CONNECTOR_ENTRY%
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
cd /d "%PROJECT_DIR%"
|
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"
|
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 (
|
if not errorlevel 1 (
|
||||||
echo Spine粒子连接器已经在运行。
|
echo Spine粒子连接器已经在运行。
|
||||||
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
powershell -NoProfile -Command "Stop-Process -Id $env:CONNECTOR_PID -Force -ErrorAction SilentlyContinue"
|
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"
|
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 (
|
if not errorlevel 1 (
|
||||||
echo Spine粒子连接器已经在运行。
|
echo Spine粒子连接器已经在运行。
|
||||||
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
echo 已发现本项目的连接器进程,但健康检查失败。请先运行停止脚本后再试。
|
echo 已发现本项目的连接器进程,但健康检查失败。请先运行停止脚本后再试。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
if "%PORT_RESULT%"=="3" (
|
if "%PORT_RESULT%"=="3" (
|
||||||
echo 27843 端口已被其他程序占用,无法启动 Spine粒子连接器。
|
echo 27843 端口已被其他程序占用,无法启动 Spine粒子连接器。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
where node >nul 2>&1
|
where node >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo 未找到 Node.js,请先安装 Node.js 18 或更高版本。
|
echo 未找到 Node.js,请先安装 Node.js 18 或更高版本。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -79,7 +81,7 @@ powershell -NoProfile -Command ^
|
|||||||
|
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo 连接器进程启动失败。
|
echo 连接器进程启动失败。
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -96,6 +98,7 @@ powershell -NoProfile -Command ^
|
|||||||
set "START_RESULT=%ERRORLEVEL%"
|
set "START_RESULT=%ERRORLEVEL%"
|
||||||
if "%START_RESULT%"=="0" (
|
if "%START_RESULT%"=="0" (
|
||||||
echo Spine粒子连接器启动成功,可以回到网页直接导出 .spine。
|
echo Spine粒子连接器启动成功,可以回到网页直接导出 .spine。
|
||||||
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -112,5 +115,5 @@ if exist "%OUT_LOG%" (
|
|||||||
)
|
)
|
||||||
powershell -NoProfile -Command "Stop-Process -Id $env:CONNECTOR_PID -Force -ErrorAction SilentlyContinue"
|
powershell -NoProfile -Command "Stop-Process -Id $env:CONNECTOR_PID -Force -ErrorAction SilentlyContinue"
|
||||||
del /q "%PID_FILE%" >nul 2>&1
|
del /q "%PID_FILE%" >nul 2>&1
|
||||||
pause
|
timeout /t 1 /nobreak >nul
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
|||||||
Reference in New Issue
Block a user