@@ -222,8 +222,7 @@ goto run
222
222
if defined noprojgen goto msbuild
223
223
224
224
@ rem Generate the VS project.
225
- echo configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
226
- python configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
225
+ call :run-python configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG%
227
226
if errorlevel 1 goto create-msvs-files-failed
228
227
if not exist node.sln goto create-msvs-files-failed
229
228
echo Project files generated.
@@ -408,7 +407,7 @@ if defined test_node_inspect goto node-test-inspect
408
407
goto node-tests
409
408
410
409
:node-check-deopts
411
- python tools\test.py --mode=release --check-deopts parallel sequential -J
410
+ call : run- python tools\test.py --mode=release --check-deopts parallel sequential -J
412
411
if defined test_node_inspect goto node-test-inspect
413
412
goto node-tests
414
413
@@ -423,8 +422,7 @@ if "%config%"=="Debug" set test_args=--mode=debug %test_args%
423
422
if " %config% " == " Release" set test_args = --mode=release %test_args%
424
423
echo running 'cctest %cctest_args% '
425
424
" %config% \cctest" %cctest_args%
426
- echo running 'python tools\test.py %test_args% '
427
- python tools\test.py %test_args%
425
+ call :run-python tools\test.py %test_args%
428
426
goto cpplint
429
427
430
428
:cpplint
@@ -442,8 +440,8 @@ test\gc\binding.cc tools\icu\*.cc tools\icu\*.h') do (
442
440
( endlocal
443
441
set cppfilelist = %localcppfilelist%
444
442
)
445
- python tools/cpplint.py %cppfilelist%
446
- python tools/check-imports.py
443
+ call : run- python tools/cpplint.py %cppfilelist%
444
+ call : run- python tools/check-imports.py
447
445
goto jslint
448
446
449
447
:add-to-list
@@ -502,6 +500,14 @@ echo vcbuild.bat build-release : builds the release distribution as used by n
502
500
echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript
503
501
goto exit
504
502
503
+ :run-python
504
+ call tools\msvs\find_python.cmd
505
+ if errorlevel 1 echo Could not find python2 & goto :exit
506
+ set cmd1 = %VCBUILD_PYTHON_LOCATION% %*
507
+ echo %cmd1%
508
+ %cmd1%
509
+ exit /b %ERRORLEVEL%
510
+
505
511
:exit
506
512
goto :EOF
507
513
@@ -513,8 +519,9 @@ rem ***************
513
519
set NODE_VERSION =
514
520
set TAG =
515
521
set FULLVERSION =
516
-
517
- for /F " usebackq tokens=*" %%i in (`python " %~dp0 tools\getnodeversion.py" `) do set NODE_VERSION = %%i
522
+ :: Call as subroutine for validation of python
523
+ call :run-python tools\getnodeversion.py > nul
524
+ for /F " tokens=*" %%i in ('%VCBUILD_PYTHON_LOCATION% tools\getnodeversion.py') do set NODE_VERSION = %%i
518
525
if not defined NODE_VERSION (
519
526
echo Cannot determine current version of Node.js
520
527
exit /b 1
@@ -523,7 +530,7 @@ if not defined NODE_VERSION (
523
530
if not defined DISTTYPE set DISTTYPE = release
524
531
if " %DISTTYPE% " == " release" (
525
532
set FULLVERSION = %NODE_VERSION%
526
- goto exit
533
+ exit /b 0
527
534
)
528
535
if " %DISTTYPE% " == " custom" (
529
536
if not defined CUSTOMTAG (
@@ -550,7 +557,4 @@ if not "%DISTTYPE%"=="custom" (
550
557
set TAG = %DISTTYPE%%DATESTRING%%COMMIT%
551
558
)
552
559
set FULLVERSION = %NODE_VERSION% -%TAG%
553
-
554
- :exit
555
- if not defined DISTTYPEDIR set DISTTYPEDIR = %DISTTYPE%
556
- goto :EOF
560
+ exit /b 0
0 commit comments