From f31faf6f14a648fc698b112293c8c9506db17ea2 Mon Sep 17 00:00:00 2001 From: viking1304 Date: Tue, 29 Oct 2024 15:54:58 +0100 Subject: [PATCH] pyenv-win compatibility - another approach (#16287) --- webui.bat | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webui.bat b/webui.bat index 7b162ce27..f29a40b36 100644 --- a/webui.bat +++ b/webui.bat @@ -4,7 +4,16 @@ if exist webui.settings.bat ( call webui.settings.bat ) -if not defined PYTHON (set PYTHON=python) +if not defined PYTHON ( + for /f "delims=" %%A in ('where python ^| findstr /n . ^| findstr ^^1:') do ( + if /i "%%~xA" == ".exe" ( + set PYTHON=python + ) else ( + set PYTHON=call python + ) + ) +) + if defined GIT (set "GIT_PYTHON_GIT_EXECUTABLE=%GIT%") if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")