Files
Bubberstation/tools/bootstrap/node.bat
SkyratBot 7584a91216 [MIRROR] Always use vendored NodeJS on Windows [MDB IGNORE] (#11079)
* Always use vendored NodeJS on Windows (#64461)

As @ SpaceManiac said:

    A big part of the point of the bootstrap scripts is to provide a reproducible environment

Here I am, web-removing the bit of code that allows using a system-wide version of NodeJS. Now we're vendored only.

* Always use vendored NodeJS on Windows

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-01-29 04:53:22 +00:00

20 lines
578 B
Batchfile

@echo off
call powershell -NoLogo -ExecutionPolicy Bypass -File "%~dp0\node_.ps1" Download-Node
for /f "tokens=* USEBACKQ" %%s in (`
call powershell -NoLogo -ExecutionPolicy Bypass -File "%~dp0\node_.ps1" Get-Path
`) do (
set "PATH=%%s;%PATH%"
)
where node.exe >nul 2>nul
if %errorlevel% == 0 (
echo | set /p printed_str="Using vendored Node "
call node.exe --version
call node.exe %*
goto exit_with_last_error_level
)
echo "node.bat: Failed to bootstrap Node!"
%COMSPEC% /c exit 1
:exit_with_last_error_level
if not %errorlevel% == 0 %COMSPEC% /c exit %errorlevel% >nul