[MIRROR] update javascript bat file (#11871)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-10-26 19:29:54 +01:00
committed by GitHub
co-authored by Kashargul
parent 6cb0a9531a
commit 74a72b43c7
+8 -7
View File
@@ -1,4 +1,5 @@
@echo off
setlocal enabledelayedexpansion
:: Call pwsh if available
set "powershellCmd=powershell"
@@ -7,21 +8,21 @@ if %errorlevel%==0 (
set "powershellCmd=pwsh"
)
call %powershellCmd% -NoLogo -ExecutionPolicy Bypass -File "%~dp0\javascript_.ps1" Download-Bun
for /f "tokens=* USEBACKQ" %%s in (`
call %powershellCmd% -NoLogo -ExecutionPolicy Bypass -File "%~dp0\javascript_.ps1" Get-Path
call %powershellCmd% -NoLogo -ExecutionPolicy Bypass -File "%~dp0javascript_.ps1" Download-Bun
for /f "usebackq delims=" %%s in (`
call %powershellCmd% -NoLogo -ExecutionPolicy Bypass -File "%~dp0javascript_.ps1" Get-Path
`) do (
set "PATH=%%s;%PATH%"
set "PATH=%%s;!PATH!"
)
where bun.exe >nul 2>nul
if %errorlevel% == 0 (
echo | set /p printed_str="Using vendored Bun "
<nul set /p="Using vendored Bun "
call bun.exe --version
call bun.exe %*
goto exit_with_last_error_level
)
echo "javascript.bat: Failed to bootstrap Bun!"
echo javascript.bat: Failed to bootstrap Bun!
%COMSPEC% /c exit 1
:exit_with_last_error_level
if not %errorlevel% == 0 %COMSPEC% /c exit %errorlevel% >nul
exit /b %errorlevel%