From 9e8cc2933e9a915c2ab79efbd5f1b8afd3aab4f4 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 13 Aug 2024 10:24:54 +0200 Subject: [PATCH] tools: add find pyenv path on windows PR-URL: https://github.com/nodejs/node/pull/54314 Reviewed-By: Yagiz Nizipli Reviewed-By: James M Snell Reviewed-By: Chengzhong Wu --- tools/msvs/find_python.cmd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/msvs/find_python.cmd b/tools/msvs/find_python.cmd index 00fb6c9afbf..17874580cb1 100644 --- a/tools/msvs/find_python.cmd +++ b/tools/msvs/find_python.cmd @@ -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