From 4f5d7f6b8f6469624ad8ef04f6f57f49b291d57a Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti <102977828+fl-ferr@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:28:11 +0200 Subject: [PATCH] Add Conda environment support to `get_search_paths_from_envs` --- src/resolve_robotics_uri_py/resolve_robotics_uri_py.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py b/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py index 234e1d7..437c3f4 100644 --- a/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py +++ b/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py @@ -11,8 +11,12 @@ def get_search_paths_from_envs(env_list): pathlib.Path(f) if (env != "AMENT_PREFIX_PATH") else pathlib.Path(f) / "share" for env in env_list if os.getenv(env) is not None for f in os.getenv(env).split(os.pathsep) - ] - + ] or ( + [pathlib.Path(os.getenv("CONDA_PREFIX")) / "share"] + if os.getenv("CONDA_PREFIX") + else [] + ) + def pathlist_list_to_string(path_list): return ' '.join(str(path) for path in path_list)