Ver Fonte

pyenv-win compatibility - another approach (#16287)

viking1304 há 9 meses atrás
pai
commit
f31faf6f14
1 ficheiros alterados com 10 adições e 1 exclusões
  1. 10 1
      webui.bat

+ 10 - 1
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")