filter out dotfiles from listings

master
Tomáš Mládek 2020-10-20 19:31:00 +02:00
parent 3306f55c0d
commit ab77d02fd9
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,10 @@ async fn render(
if let Ok(entry) = entry {
let path = entry.path();
if path.is_file() {
return Some(path.strip_prefix(&state.garden_dir).unwrap().to_path_buf());
let stripped_path = path.strip_prefix(&state.garden_dir).unwrap().to_path_buf();
if !stripped_path.to_str().unwrap().starts_with(".") {
return Some(stripped_path);
}
}
}
None