2024-04-11 04:36:44 +00:00
|
|
|
@echo off
|
|
|
|
setlocal EnableDelayedExpansion
|
2024-04-18 11:08:44 +00:00
|
|
|
set version=%~1
|
|
|
|
for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b
|
2024-04-11 04:36:44 +00:00
|
|
|
|
2024-05-15 09:18:08 +00:00
|
|
|
set root_path=%devenver_root%\NodeJS
|
|
|
|
set bin_path=%root_path%\%version%
|
|
|
|
|
2024-04-18 11:08:44 +00:00
|
|
|
if "%~1"=="help" goto :help
|
|
|
|
if "%~1"=="" goto :help
|
|
|
|
if "%~1"=="--help" goto :help
|
|
|
|
if "%~1"=="/?" goto :help
|
2024-04-11 04:36:44 +00:00
|
|
|
goto :run
|
|
|
|
|
|
|
|
:help
|
2024-04-18 11:08:44 +00:00
|
|
|
echo USAGE: node_env.bat ^<version^> [^<command^>]
|
2024-04-11 04:36:44 +00:00
|
|
|
echo.
|
|
|
|
echo VERSIONS:
|
|
|
|
ls %root_path%
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
:run
|
2024-05-15 09:18:08 +00:00
|
|
|
echo [SCRIPT] Adding to path '%bin_path%' and executing '%remaining_args%'
|
|
|
|
set PATH=%bin_path%;%PATH%
|
2024-04-18 11:08:44 +00:00
|
|
|
%remaining_args%
|