@@ -174,8 +174,7 @@ goto run
174
174
if defined noprojgen goto msbuild
175
175
176
176
@ rem Generate the VS project.
177
- echo configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
178
- python configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
177
+ call :run-python configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
179
178
if errorlevel 1 goto create-msvs-files-failed
180
179
if not exist node.sln goto create-msvs-files-failed
181
180
echo Project files generated.
@@ -340,8 +339,7 @@ if "%config%"=="Debug" set test_args=--mode=debug %test_args%
340
339
if " %config% " == " Release" set test_args = --mode=release %test_args%
341
340
echo running 'cctest %cctest_args% '
342
341
" %config% \cctest" %cctest_args%
343
- echo running 'python tools\test.py %test_args% '
344
- python tools\test.py %test_args%
342
+ call :run-python tools\test.py %test_args%
345
343
goto jslint
346
344
347
345
:jslint
@@ -377,6 +375,14 @@ echo vcbuild.bat build-release : builds the release distribution as used by n
377
375
echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript
378
376
goto exit
379
377
378
+ :run-python
379
+ call tools\msvs\find_python.cmd
380
+ if errorlevel 1 echo Could not find python2 & goto :exit
381
+ set cmd1 = %VCBUILD_PYTHON_LOCATION% %*
382
+ echo %cmd1%
383
+ %cmd1%
384
+ exit /b %ERRORLEVEL%
385
+
380
386
:exit
381
387
goto :EOF
382
388
@@ -388,8 +394,9 @@ rem ***************
388
394
set NODE_VERSION =
389
395
set TAG =
390
396
set FULLVERSION =
391
-
392
- for /F " usebackq tokens=*" %%i in (`python " %~dp0 tools\getnodeversion.py" `) do set NODE_VERSION = %%i
397
+ :: Call as subroutine for validation of python
398
+ call :run-python tools\getnodeversion.py > nul
399
+ for /F " tokens=*" %%i in ('%VCBUILD_PYTHON_LOCATION% tools\getnodeversion.py') do set NODE_VERSION = %%i
393
400
if not defined NODE_VERSION (
394
401
echo Cannot determine current version of Node.js
395
402
exit /b 1
@@ -398,7 +405,7 @@ if not defined NODE_VERSION (
398
405
if not defined DISTTYPE set DISTTYPE = release
399
406
if " %DISTTYPE% " == " release" (
400
407
set FULLVERSION = %NODE_VERSION%
401
- goto exit
408
+ exit /b 0
402
409
)
403
410
if " %DISTTYPE% " == " custom" (
404
411
if not defined CUSTOMTAG (
@@ -425,7 +432,4 @@ if not "%DISTTYPE%"=="custom" (
425
432
set TAG = %DISTTYPE%%DATESTRING%%COMMIT%
426
433
)
427
434
set FULLVERSION = %NODE_VERSION% -%TAG%
428
-
429
- :exit
430
- if not defined DISTTYPEDIR set DISTTYPEDIR = %DISTTYPE%
431
- goto :EOF
435
+ exit /b 0
0 commit comments