From 7bcbf526f357aca014e6bff8e833572ba38f721f Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 8 Mar 2023 20:37:06 +0100 Subject: dont show hidden files --- src/files.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/files.rs') diff --git a/src/files.rs b/src/files.rs index 555e8ae..2ba9a9f 100644 --- a/src/files.rs +++ b/src/files.rs @@ -200,6 +200,7 @@ async fn index(path: &Path, rpath: String) -> Result { let files = path .read_dir()? .map(|e| e.and_then(|e| Ok((e.file_name().into_string().unwrap(), e.metadata()?)))) + .filter(|e| e.as_ref().map(|(e, _)| !e.starts_with(".")).unwrap_or(true)) .collect::, _>>()?; if let Ok(indexhtml) = read_to_string(path.join("index.html")).await { Ok(indexhtml) -- cgit v1.2.3-70-g09d2