From 804f16394879853c54dc0eb82608b0e2c0d42e40 Mon Sep 17 00:00:00 2001 From: Mike Purvis Date: Mon, 23 Jan 2023 18:18:30 +0000 Subject: [PATCH] Follow symlinks when walking. Signed-off-by: Mike Purvis --- ros2launch/ros2launch/api/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2launch/ros2launch/api/api.py b/ros2launch/ros2launch/api/api.py index 3bdb5bd1..b0cbfa4d 100644 --- a/ros2launch/ros2launch/api/api.py +++ b/ros2launch/ros2launch/api/api.py @@ -46,7 +46,7 @@ def get_share_file_path_from_package(*, package_name, file_name): """ package_share_directory = get_package_share_directory(package_name) matching_file_paths = [] - for root, dirs, files in os.walk(package_share_directory): + for root, dirs, files in os.walk(package_share_directory, followlinks=True): for name in files: if name == file_name: matching_file_paths.append(os.path.join(root, name)) @@ -68,7 +68,7 @@ def get_share_file_path_from_package(*, package_name, file_name): def get_launch_file_paths(*, path): """Return a list of paths to launch files within a given path.""" launch_file_paths = [] - for root, dirs, files in os.walk(path): + for root, dirs, files in os.walk(path, followlinks=True): for file_name in files: file_path = os.path.join(root, file_name) if is_launch_file(path=file_path):