From 1a1ff20f40601bfddee1c668e337201045779c4a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 14 May 2021 14:06:15 -0500 Subject: [PATCH] fix(cli): Discover config in parent dirs My only guess is that in a76ddd42, I lost track of different parts of my change and never re-implemented this logic. --- src/policy.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/policy.rs b/src/policy.rs index 020eeb0..1115c72 100644 --- a/src/policy.rs +++ b/src/policy.rs @@ -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() {