Feat: using MinGit for bat install and update

This commit is contained in:
litagin02
2024-03-16 11:56:48 +09:00
parent 386d122cc7
commit 8a8cd1dcaf
5 changed files with 100 additions and 214 deletions

View File

@@ -2,51 +2,42 @@ chcp 65001 > NUL
@echo off
pushd %~dp0
set PS_CMD=PowerShell -Version 5.1 -ExecutionPolicy Bypass
set CURL_CMD=C:\Windows\System32\curl.exe
if not exist %CURL_CMD% (
echo [ERROR] %CURL_CMD% が見つかりません。
pause & popd & exit /b 1
)
set PATH=%~dp0lib\MinGit\cmd;%PATH%
@REM Style-Bert-VITS2.zip をGitHubのmasterの最新のものをダウンロード
%CURL_CMD% -Lo Style-Bert-VITS2.zip^
https://github.com/litagin02/Style-Bert-VITS2/archive/refs/heads/master.zip
pushd Style-Bert-VITS2
echo --------------------------------------------------
echo Checking Git Installation...
echo --------------------------------------------------
git --version
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
@REM Style-Bert-VITS2.zip を解凍フォルダ名前がBert-VITS2-masterになる
%PS_CMD% Expand-Archive -Path Style-Bert-VITS2.zip -DestinationPath . -Force
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
pause
@REM 元のzipを削除
del Style-Bert-VITS2.zip
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
@REM Bert-VITS2-masterの中身をStyle-Bert-VITS2に上書き移動
xcopy /QSY .\Style-Bert-VITS2-master\ .\Style-Bert-VITS2\
rmdir /s /q Style-Bert-VITS2-master
echo --------------------------------------------------
echo Git pull...
echo --------------------------------------------------
git pull
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
@REM 仮想環境のpip requirements.txtを更新
echo call .\Style-Bert-VITS2\scripts\activate.bat
call .\Style-Bert-VITS2\venv\Scripts\activate.bat
echo --------------------------------------------------
echo Updating dependencies...
echo --------------------------------------------------
@REM 仮想環境を有効化
call .\venv\Scripts\activate.bat
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
pip install -U -r Style-Bert-VITS2\requirements.txt
pip install -U -r requirements.txt
if %errorlevel% neq 0 ( pause & popd & exit /b %errorlevel% )
echo ----------------------------------------
echo Update completed. Running Style-Bert-VITS2 Editor...
echo Update completed.
echo ----------------------------------------
@REM Style-Bert-VITS2フォルダに移動
pushd Style-Bert-VITS2
@REM Style-Bert-VITS2 Editorを起動
python server_editor.py --inbrowser
pause
popd