Only include config files with names ending in .pr

This commit is contained in:
Tony Garnock-Jones 2021-10-07 21:37:24 +02:00
parent c51f6b2a4e
commit fb744082b9
1 changed files with 5 additions and 1 deletions

View File

@ -96,13 +96,17 @@ fn is_hidden(path: &PathBuf) -> bool {
}
}
fn should_process(path: &PathBuf) -> bool {
path.file_name().and_then(|n| n.to_str()).map(|n| n.ends_with(".pr")).unwrap_or(false)
}
fn scan_file(
t: &mut Activation,
path_state: &mut Map<PathBuf, FacetId>,
env: script::Env,
) -> bool {
let path = env.path.clone();
if is_hidden(&path) {
if is_hidden(&path) || !should_process(&path) {
return true;
}
tracing::trace!("scan_file: scanning {:?}", &path);