The UFZ services GitLab and Mattermost will be unavailable on Monday, January 24 from 06:00 AM to 08:00 AM due to maintenance work.

Want to get a quick-start introduction to Shell, Git and GitLab? Join the next beginners course on 28/31 January. Register now!

Commit d3cc1c15 authored by Adam Reichold's avatar Adam Reichold
Browse files

Recurse into directories if they are given directly on the command line or via glob patterns.

parent b3c87048
Pipeline #42382 passed with stage
in 1 minute and 22 seconds
......@@ -65,10 +65,29 @@ fn main() -> Fallible {
let inputs_sender = inputs_sender.clone();
spawn(move || {
let mut dirs = Vec::new();
for input in glob(&inputs)? {
let input = input?;
inputs_sender.send(input).unwrap();
if input.is_dir() {
dirs.push(input);
} else {
inputs_sender.send(input).unwrap();
}
}
while let Some(dir) = dirs.pop() {
for entry in dir.read_dir()? {
let entry = entry?;
let path = entry.path();
if entry.file_type()?.is_dir() {
dirs.push(path);
} else {
inputs_sender.send(path).unwrap();
}
}
}
Ok(())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment