exclude symlinks from index
This commit is contained in:
parent
46a42710e1
commit
331129fc06
1 changed files with 5 additions and 1 deletions
|
@ -183,7 +183,11 @@ fn generate_index(relative_path: &str, path: &Path) -> Option<Content> {
|
||||||
.ok()?
|
.ok()?
|
||||||
.flatten()
|
.flatten()
|
||||||
.filter_map(|d| {
|
.filter_map(|d| {
|
||||||
let size = if d.file_type().ok()?.is_dir() {
|
let file_type = d.file_type().ok()?;
|
||||||
|
if !(file_type.is_file() || file_type.is_dir()) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let size = if file_type.is_dir() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(d.metadata().ok()?.len())
|
Some(d.metadata().ok()?.len())
|
||||||
|
|
Loading…
Reference in a new issue