Fix: eneabledelayedexpansion for error code

This commit is contained in:
litagin02
2024-03-16 16:49:22 +09:00
parent 5eef8843cc
commit f2cc879603
4 changed files with 62 additions and 36 deletions

View File

@@ -1,9 +1,11 @@
chcp 65001 > NUL
@echo off
@REM エラーコードを遅延評価するために設定
setlocal enabledelayedexpansion
pushd %~dp0
set PATH=%~dp0lib\MinGit\cmd;%PATH%
pushd Style-Bert-VITS2
@@ -11,7 +13,24 @@ echo --------------------------------------------------
echo Checking Git Installation...
echo --------------------------------------------------
git --version
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
if !errorlevel! neq 0 (
echo --------------------------------------------------
echo Global Git is not installed, so use PortableGit.
echo Setting up PATH...
echo --------------------------------------------------
echo Executing: set "PATH=%~dp0lib\PortableGit\bin;%PATH%"
pause
set "PATH=%~dp0lib\PortableGit\bin;%PATH%"
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
echo --------------------------------------------------
echo Checking Git Installation...
echo --------------------------------------------------
echo Executing: git --version
pause
git --version
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
)
pause
@@ -19,7 +38,7 @@ echo --------------------------------------------------
echo Git pull...
echo --------------------------------------------------
git pull
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
@REM 仮想環境のpip requirements.txtを更新
@@ -29,10 +48,10 @@ echo --------------------------------------------------
@REM 仮想環境を有効化
call .\venv\Scripts\activate.bat
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
pip install -U -r requirements.txt
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
echo ----------------------------------------
echo Update completed.