Skip to content

Commit b415cc2

Browse files
committed
fix trailing slash in exclude pattern #178
1 parent c8cf756 commit b415cc2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/language.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,12 @@ fn project_languages(dir: &str, ignored_directories: Vec<&str>) -> tokei::Langua
400400
let mut v = Vec::with_capacity(ignored_directories.len());
401401
for ignored in ignored_directories {
402402
if re.is_match(ignored) {
403-
v.push(format!("{}{}", "**/", ignored));
403+
let p = if ignored.starts_with("/") {
404+
"**"
405+
} else {
406+
"**/"
407+
};
408+
v.push(format!("{}{}", p, ignored));
404409
} else {
405410
v.push(String::from(ignored));
406411
}

0 commit comments

Comments
 (0)