Skip to content

Commit

Permalink
Do not require PYTHON_VERSION to be defined in .bat files (#4770) (#4798
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 39e8957)

Co-authored-by: Mario Domínguez López <[email protected]>
  • Loading branch information
mergify[bot] and Mario-DL authored May 24, 2024
1 parent db3d420 commit db64268
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions tools/fastdds/fastdds.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ if not %ERRORLEVEL%==0 (
)

:: Python version in the form "Major.Minor"
if %PYTHON_VERSION%=="" (
echo error retrieving python version. Please, make sure python is installed and accessible.
exit /B 65
)
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%
) else (
:: Use launcher to profit from shebang hints on fastdds.py
:: Select latest available python version
py "%dir%\..\tools\fastdds\fastdds.py" %args%
)

:: 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%
15 changes: 8 additions & 7 deletions tools/fastdds/ros-discovery.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ if not %ERRORLEVEL%==0 (
)

:: Python version in the form "Major.Minor"
if %PYTHON_VERSION%=="" (
echo error retrieving python version. Please, make sure python is installed and accessible.
exit /B 65
)
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%
) else (
:: Use launcher to profit from shebang hints on fastdds.py
:: Select latest available python version
py "%dir%\..\tools\fastdds\fastdds.py" discovery %args%
)

:: 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%

0 comments on commit db64268

Please sign in to comment.