-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathupdate.bat
More file actions
75 lines (68 loc) · 1.84 KB
/
update.bat
File metadata and controls
75 lines (68 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@echo off
cd /d "%~dp0"
set PATH=%LOCALAPPDATA%\Microsoft\WinGet\Links;%PATH%
echo ========================================
echo LiveTranslate Updater
echo ========================================
echo.
:: Check git
git --version >nul 2>&1
if errorlevel 1 (
echo Git not found, attempting to install via winget...
winget --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Git not found and winget is not available.
echo Please install Git from https://git-scm.com/downloads
pause
exit /b 1
)
winget install Git.Git --accept-package-agreements --accept-source-agreements
if errorlevel 1 (
echo [ERROR] Git installation failed.
pause
exit /b 1
)
:: Refresh PATH
set "PATH=%LOCALAPPDATA%\Microsoft\WinGet\Links;%ProgramFiles%\Git\cmd;%PATH%"
git --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Git installed but not found in PATH. Please restart and try again.
pause
exit /b 1
)
echo Git installed successfully.
echo.
)
:: Pull latest code
echo Pulling latest changes...
git pull
if errorlevel 1 (
echo.
echo [ERROR] git pull failed. Check for local conflicts.
pause
exit /b 1
)
:: Check venv
if not exist ".venv\Scripts\pip.exe" (
echo.
echo Virtual environment not found, running install.bat...
call install.bat
exit /b %errorlevel%
)
:: Update dependencies
echo.
echo Updating dependencies...
.venv\Scripts\pip.exe install -r requirements.txt --quiet
if errorlevel 1 (
echo [WARN] Some dependencies failed to update.
)
.venv\Scripts\pip.exe install funasr --no-deps --quiet
.venv\Scripts\pip.exe install pysbd --quiet
echo.
echo ========================================
echo Update complete!
echo ========================================
echo.
echo Double-click start.bat to launch.
echo.
pause