Skip to content

Commit 1a1ff20

Browse files
author
Ed Page
committed
fix(cli): Discover config in parent dirs
My only guess is that in a76ddd4, I lost track of different parts of my change and never re-implemented this logic.
1 parent a0c592f commit 1a1ff20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/policy.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ impl<'s> ConfigEngine<'s> {
123123
let mut config = crate::config::Config::default();
124124

125125
if !self.isolated {
126-
if let Some(derived) = crate::config::Config::from_dir(cwd)? {
127-
config.update(&derived);
126+
for ancestor in cwd.ancestors() {
127+
if let Some(derived) = crate::config::Config::from_dir(ancestor)? {
128+
config.update(&derived);
129+
break;
130+
}
128131
}
129132
}
130133
if let Some(overrides) = self.overrides.as_ref() {

0 commit comments

Comments
 (0)