summaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
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