From 0b40b06661754b1944de752376db7eef058f3d6b Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 11 Apr 2024 14:36:44 +1000 Subject: [PATCH] Add more flexible node env script --- Win/Scripts/node-12.22.12_env.bat | 7 ------- Win/Scripts/node-16.19.0_env.bat | 7 ------- Win/Scripts/node-18.15.0_env.bat | 7 ------- Win/Scripts/node_env.bat | 23 +++++++++++++++++++++++ 4 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 Win/Scripts/node-12.22.12_env.bat delete mode 100644 Win/Scripts/node-16.19.0_env.bat delete mode 100644 Win/Scripts/node-18.15.0_env.bat create mode 100644 Win/Scripts/node_env.bat diff --git a/Win/Scripts/node-12.22.12_env.bat b/Win/Scripts/node-12.22.12_env.bat deleted file mode 100644 index 9d5454a..0000000 --- a/Win/Scripts/node-12.22.12_env.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -setlocal - set path_to_add=%devenver_root%\NodeJS\12.22.12 - set path=%path_to_add%;%path% - echo [DEVENVER] "%~dpnx0" is adding to path "%path_to_add%" - call %* -endlocal diff --git a/Win/Scripts/node-16.19.0_env.bat b/Win/Scripts/node-16.19.0_env.bat deleted file mode 100644 index fbb6d7d..0000000 --- a/Win/Scripts/node-16.19.0_env.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -setlocal - set path_to_add=%devenver_root%\NodeJS\16.19.0 - set path=%path_to_add%;%path% - echo [DEVENVER] "%~dpnx0" is adding to path "%path_to_add%" - call %* -endlocal diff --git a/Win/Scripts/node-18.15.0_env.bat b/Win/Scripts/node-18.15.0_env.bat deleted file mode 100644 index dc7417a..0000000 --- a/Win/Scripts/node-18.15.0_env.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -setlocal - set path_to_add=%devenver_root%\NodeJS\18.15.0 - set path=%path_to_add%;%path% - echo [DEVENVER] "%~dpnx0" is adding to path "%path_to_add%" - call %* -endlocal diff --git a/Win/Scripts/node_env.bat b/Win/Scripts/node_env.bat new file mode 100644 index 0000000..aa9ef6b --- /dev/null +++ b/Win/Scripts/node_env.bat @@ -0,0 +1,23 @@ +@echo off +setlocal EnableDelayedExpansion +set root_path=%devenver_root%\NodeJS + +if "%~1"=="help" goto :help +if "%~1"=="" goto :help +if "%~1"=="--help" goto :help +if "%~1"=="/?" goto :help +goto :run + +:help +echo USAGE: node_env.bat ^ ^ +echo. +echo VERSIONS: +ls %root_path% +goto :eof + +:run +set version=%~1 +for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b +echo [SCRIPT] Executing %root_path%\%version%\%remaining_args% + +%root_path%\%version%\%remaining_args%