Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21037] Use %* instead of loop in .bat scripts #4814

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions tools/fastdds/fastdds.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" %*
)

13 changes: 2 additions & 11 deletions tools/fastdds/ros-discovery.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %*
)

Loading