summaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-10-17 15:51:31 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-10-20 20:21:44 +0200
commite56577e4506c7db72aef9e273cfa00592ca20829 (patch)
tree56f20cef616bcff2223fd8db4cf1cb7df5157291 /src/Config.hs
parent5f892bc3cd212f362b0a8f29528b783b142da8e8 (diff)
Do not look for config file in parent dirs in test mode
Diffstat (limited to 'src/Config.hs')
-rw-r--r--src/Config.hs7
1 files changed, 4 insertions, 3 deletions
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