tools: add find pyenv path on windows

PR-URL: https://github.com/nodejs/node/pull/54314
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Marco Ippolito 2024-08-13 10:24:54 +02:00 committed by GitHub
parent a199c529bc
commit 9e8cc2933e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,13 @@ for %%k in ( "HKCU\Software", "HKLM\SOFTWARE", "HKLM\Software\Wow6432Node") do (
if not errorlevel 1 goto :found-python
)
:: Check for pyenv-win installation using pyenv which python
for /f "tokens=*" %%i in ('pyenv which python 2^>nul') do set p=%%i
if defined p (
for /f "tokens=*" %%j in ('"%p%" --version') do set python_version=%%j
goto :found-python
)
goto :no-python