Skip to content

Commit

Permalink
Ignore non-yaml files in ID dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Feb 22, 2021
1 parent e24323e commit 9e3108f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crev-lib/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ impl Local {
let ids_path = self.user_ids_path();
let mut ids = vec![];
for dir_entry in std::fs::read_dir(&ids_path)? {
let locked_id = LockedId::read_from_yaml_file(&dir_entry?.path())?;
ids.push(locked_id.to_public_id())
let path = dir_entry?.path();
if path.extension().map_or(false, |ext| ext == "yaml") {
let locked_id = LockedId::read_from_yaml_file(&path)?;
ids.push(locked_id.to_public_id())
}
}

Ok(ids)
Expand Down

0 comments on commit 9e3108f

Please sign in to comment.