From d8ec40ec879d9e0dc6c205ae84aa11294496312f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 07:15:23 +0200 Subject: [PATCH] Use `%*` instead of loop in `.bat` scripts. (#4814) (#4818) Signed-off-by: Miguel Company (cherry picked from commit 2552fa9cd010f4e08d4c77b01c16e34784056388) Co-authored-by: Miguel Company --- 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 de259c851d..c23d8527cc 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 66380408ac..141ab6ac5b 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 %* )