From 1d9d69b076e101ee67842b4e82423e8d57559544 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 18 Nov 2018 12:37:14 +0100 Subject: Allow v2-build projects to not have a cabal.project file --- lib/Distribution/Helper.hs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs index 34d7247..0c2fddb 100644 --- a/lib/Distribution/Helper.hs +++ b/lib/Distribution/Helper.hs @@ -197,18 +197,12 @@ getProjConfModTime ProjConfV1{pcV1CabalFile} = [ pcV1CabalFile ] getProjConfModTime ProjConfV2{..} = do - mandatory <- mapM getFileModTime $ - [ pcV2CabalProjFile - ] - optional <- mapM (traverse getFileModTime <=< mightExist) - [ pcV2CabalProjLocalFile - , pcV2CabalProjFreezeFile - ] - return $ - ProjConfModTimes $ - mandatory ++ - catMaybes optional - + fmap (ProjConfModTimes . catMaybes) $ + mapM (traverse getFileModTime <=< mightExist) + [ pcV2CabalProjFile + , pcV2CabalProjLocalFile + , pcV2CabalProjFreezeFile + ] getProjConfModTime ProjConfStack{..} = fmap ProjConfModTimes $ mapM getFileModTime [ pcStackYaml -- cgit v1.2.3