Skip to content

Commit ae46196

Browse files
joaocgreistargos
authored andcommitted
build,win: goto lint only after defining node_exe
When running `vcbuild lint` on a new prompt where vcbuild was not run before, `%node_exe%` was not defined and `eslint.js`, `lint-js.js` and `lint-md.js` would be run directly using the program defined in Windows (usually the Windows Scripting Host or Notepad). This moves the goto statement to after `%node_exe%` is defined. Fixes: #29602 PR-URL: #29616 Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent ef033d0 commit ae46196

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

vcbuild.bat

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ goto next-arg
152152

153153
:args-done
154154

155-
if "%*"=="lint" (
156-
goto lint-cpp
157-
)
158-
159155
if defined build_release (
160156
set config=Release
161157
set package=1
@@ -178,6 +174,9 @@ set "npm_exe="%~dp0%node_exe%" %~dp0deps\npm\bin\npm-cli.js"
178174
if "%target_env%"=="vs2017" set "node_gyp_exe=%node_gyp_exe% --msvs_version=2017"
179175
if "%target_env%"=="vs2019" set "node_gyp_exe=%node_gyp_exe% --msvs_version=2019"
180176

177+
:: skip building if the only argument received was lint
178+
if "%*"=="lint" if exist "%node_exe%" goto lint-cpp
179+
181180
if "%config%"=="Debug" set configure_flags=%configure_flags% --debug
182181
if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot
183182
if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1
@@ -641,7 +640,7 @@ if not defined lint_cpp goto lint-js
641640
if defined NODEJS_MAKE goto run-make-lint
642641
where make > NUL 2>&1 && make -v | findstr /C:"GNU Make" 1> NUL
643642
if "%ERRORLEVEL%"=="0" set "NODEJS_MAKE=make PYTHON=python" & goto run-make-lint
644-
where wsl > NUL 2>1
643+
where wsl > NUL 2>&1
645644
if "%ERRORLEVEL%"=="0" set "NODEJS_MAKE=wsl make" & goto run-make-lint
646645
echo Could not find GNU Make, needed for linting C/C++
647646
goto lint-js

0 commit comments

Comments
 (0)