Skip to content

Commit

Permalink
Return emptuy package vec if AMENT_PREFIX_PATH points to ''
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed Apr 26, 2024
1 parent 03ad014 commit e932c1d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, path::Path};
use std::{collections::HashMap, io::Empty, path::Path};

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / ROS2 Bridge Examples

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Examples (macos-13)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Examples (ubuntu-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Examples (ubuntu-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Test (windows-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Test (windows-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Test (windows-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Examples (windows-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Examples (windows-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Test (macos-latest)

unused import: `io::Empty`

Check warning on line 1 in libraries/extensions/ros2-bridge/msg-gen/src/parser/package.rs

View workflow job for this annotation

GitHub Actions / Clippy

unused import: `io::Empty`

use anyhow::{Context, Result};
use glob::glob;
Expand All @@ -11,6 +11,13 @@ fn get_ros_msgs_each_package<P: AsRef<Path>>(root_dir: P) -> Result<Vec<Package>
let mut map: HashMap<String, Package> = HashMap::new();

let ros_formats = vec!["msg", "srv", "action"];

if root_dir.as_ref() != Path::new("") {
let empty_vec: Vec<Package> = vec![];
warn!("AMENT_PREFIX_PATH pointed to ''");
return Ok(empty_vec);
}

for ros_format in ros_formats {
let pattern = root_dir.as_ref().to_string_lossy().to_string()
+ "/**/"
Expand Down

0 comments on commit e932c1d

Please sign in to comment.