Skip to content

Commit

Permalink
Merge pull request kohya-ss#895 from bmaltais/dev2
Browse files Browse the repository at this point in the history
Fix setup logic... again
  • Loading branch information
bmaltais authored Jun 3, 2023
2 parents fa36e49 + 985bf19 commit 89bd298
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
3 changes: 3 additions & 0 deletions gui.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set "yellow_text="
set "blue_text="
set "reset_text="

:: Deactivate the virtual environment
call .\venv\Scripts\deactivate.bat

REM Run pip freeze and capture the output
for /f "delims=" %%I in ('pip freeze') do (
set "pip_output=%%I"
Expand Down
30 changes: 17 additions & 13 deletions setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ set "yellow_text="
set "blue_text="
set "reset_text="

set PYTHON_VER=3.10.9

REM Check if Python version meets the recommended version
python --version 2>nul | findstr /b /c:"Python %PYTHON_VER%" >nul
if errorlevel 1 (
echo Warning: Python version %PYTHON_VER% is recommended.
)

IF NOT EXIST venv (
python -m venv venv
) ELSE (
echo venv folder already exists, skipping creation...
)

:: Deactivate the virtual environment
call .\venv\Scripts\deactivate.bat

REM Run pip freeze and capture the output
for /f "delims=" %%I in ('pip freeze') do (
set "pip_output=%%I"
Expand Down Expand Up @@ -52,19 +69,6 @@ if /i "%choice%"=="1" (
:ContinueSetup
endlocal

set PYTHON_VER=3.10.9

REM Check if Python version meets the recommended version
python --version 2>nul | findstr /b /c:"Python %PYTHON_VER%" >nul
if errorlevel 1 (
echo Warning: Python version %PYTHON_VER% is recommended.
)

IF NOT EXIST venv (
python -m venv venv
) ELSE (
echo venv folder already exists, skipping creation...
)
call .\venv\Scripts\activate.bat

REM Upgrade pip if needed
Expand Down

0 comments on commit 89bd298

Please sign in to comment.