repo: ignore non-".toml" files when reading recipes
This commit is contained in:
parent
892bfa0d3b
commit
4bdb08f9a3
1 changed files with 11 additions and 6 deletions
|
|
@ -60,6 +60,8 @@ impl Repo {
|
||||||
// println!("trying {:?} ({:?})", dir_entry, file_type);
|
// println!("trying {:?} ({:?})", dir_entry, file_type);
|
||||||
if file_type.is_file() {
|
if file_type.is_file() {
|
||||||
let path = dir_entry.path();
|
let path = dir_entry.path();
|
||||||
|
match path.extension() {
|
||||||
|
Some(s) if s.eq("toml") => {
|
||||||
match self.add_file(&path) {
|
match self.add_file(&path) {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
// println!("added {:?}", dir_entry);
|
// println!("added {:?}", dir_entry);
|
||||||
|
|
@ -68,6 +70,9 @@ impl Repo {
|
||||||
println!("failed to read recipe from {:?}: {:?}", path, e);
|
println!("failed to read recipe from {:?}: {:?}", path, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
_ => (), // skip unknown file extensions
|
||||||
|
}
|
||||||
} else if file_type.is_dir() {
|
} else if file_type.is_dir() {
|
||||||
let _ = self.add_dir(dir_entry.path().to_str().unwrap());
|
let _ = self.add_dir(dir_entry.path().to_str().unwrap());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue