forked from Nerogar/OneTrainer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.bat
44 lines (36 loc) · 903 Bytes
/
update.bat
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
@echo off
if not defined GIT (set GIT=git)
if not defined PYTHON (set PYTHON=python)
if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")
:git_pull
echo pulling updates
%GIT% pull
if %ERRORLEVEL% == 0 goto :check_venv
echo could not pull updates
goto :end_error
:check_venv
dir "%VENV_DIR%" > NUL 2> NUL
if %ERRORLEVEL% == 0 goto :activate_venv
echo venv not found, please run install.bat first
goto :end_error
:activate_venv
echo activating venv %VENV_DIR%
set PYTHON="%VENV_DIR%\Scripts\python.exe"
:install_dependencies
echo installing dependencies
%PYTHON% -m pip install --upgrade --upgrade-strategy eager pip setuptools
%PYTHON% -m pip install --upgrade --upgrade-strategy eager -r requirements.txt
:end_success
echo.
echo ***********
echo Update done
echo ***********
goto:end
:end_error
echo.
echo *******************
echo Error during update
echo *******************
goto:end
:end
pause