From e56577e4506c7db72aef9e273cfa00592ca20829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 17 Oct 2026 15:51:31 +0200 Subject: Do not look for config file in parent dirs in test mode --- src/Config.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Config.hs') diff --git a/src/Config.hs b/src/Config.hs index 8555540..e243609 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -71,19 +71,20 @@ instance FromYAML ConfigTool where , ToolCabal <$> m .: "cabal" ] -findConfig :: IO (Maybe FilePath) -findConfig = go "." +findConfig :: Bool -> IO (Maybe FilePath) +findConfig tryParents = go "." where name = "erebos-tester.yaml" go path = do doesFileExist (path name) >>= \case True -> return $ Just $ path name - False -> doesDirectoryExist (path "..") >>= \case + False | tryParents -> doesDirectoryExist (path "..") >>= \case True -> do parent <- canonicalizePath $ path ".." if parent /= path then go parent else return Nothing False -> return Nothing + False -> return Nothing parseConfig :: FilePath -> IO Config parseConfig path = do -- cgit v1.2.3