Skip to content

Commit

Permalink
fix(cli): Discover config in parent dirs
Browse files Browse the repository at this point in the history
My only guess is that in a76ddd4, I lost track of different parts of my
change and never re-implemented this logic.
  • Loading branch information
Ed Page committed May 14, 2021
1 parent a0c592f commit 1a1ff20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ impl<'s> ConfigEngine<'s> {
let mut config = crate::config::Config::default();

if !self.isolated {
if let Some(derived) = crate::config::Config::from_dir(cwd)? {
config.update(&derived);
for ancestor in cwd.ancestors() {
if let Some(derived) = crate::config::Config::from_dir(ancestor)? {
config.update(&derived);
break;
}
}
}
if let Some(overrides) = self.overrides.as_ref() {
Expand Down

0 comments on commit 1a1ff20

Please sign in to comment.