From 266de30a122704381345f07893ba3b41d04c9204 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 21 May 2024 11:04:57 +0200 Subject: [PATCH] Use `%*` instead of loop in `.bat` scripts. (#4814) Signed-off-by: Miguel Company (cherry picked from commit 2552fa9cd010f4e08d4c77b01c16e34784056388) --- tools/fastdds/fastdds.bat | 13 ++----------- tools/fastdds/ros-discovery.bat | 13 ++----------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/tools/fastdds/fastdds.bat b/tools/fastdds/fastdds.bat index de259c851d9..c23d8527cc8 100644 --- a/tools/fastdds/fastdds.bat +++ b/tools/fastdds/fastdds.bat @@ -2,15 +2,6 @@ setlocal set dir=%~dp0 -set args=%1 - -:getarg -shift -if "%~1"=="" goto continue -set args=%args% %1 -goto getarg - -:continue :: Check python py --list > NUL 2>&1 @@ -25,10 +16,10 @@ if not %ERRORLEVEL%==0 ( if not "%PYTHON_VERSION%" == "" ( :: Use launcher to profit from shebang hints on fastdds.py :: Select the correct python version to source the appropriate paths - py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" %args% + py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" %* ) else ( :: Use launcher to profit from shebang hints on fastdds.py :: Select latest available python version - py "%dir%\..\tools\fastdds\fastdds.py" %args% + py "%dir%\..\tools\fastdds\fastdds.py" %* ) diff --git a/tools/fastdds/ros-discovery.bat b/tools/fastdds/ros-discovery.bat index 66380408acc..141ab6ac5ba 100644 --- a/tools/fastdds/ros-discovery.bat +++ b/tools/fastdds/ros-discovery.bat @@ -2,15 +2,6 @@ setlocal set dir=%~dp0 -set args=%1 - -:getarg -shift -if "%~1"=="" goto continue -set args=%args% %1 -goto getarg - -:continue :: Check python py --list > NUL 2>&1 @@ -25,10 +16,10 @@ if not %ERRORLEVEL%==0 ( if not "%PYTHON_VERSION%" == "" ( :: Use launcher to profit from shebang hints on fastdds.py :: Select the correct python version to source the appropriate paths - py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" discovery %args% + py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" discovery %* ) else ( :: Use launcher to profit from shebang hints on fastdds.py :: Select latest available python version - py "%dir%\..\tools\fastdds\fastdds.py" discovery %args% + py "%dir%\..\tools\fastdds\fastdds.py" discovery %* )