aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution/Helper.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-11-18 12:37:14 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-01-22 03:06:51 +0100
commit1d9d69b076e101ee67842b4e82423e8d57559544 (patch)
tree8dbf5569edfd8c80be01d348cf78e9a0e0d3ac95 /lib/Distribution/Helper.hs
parentcea2d0fa80adc6720492fca8b84ac65ec302c6dd (diff)
Allow v2-build projects to not have a cabal.project file
Diffstat (limited to 'lib/Distribution/Helper.hs')
-rw-r--r--lib/Distribution/Helper.hs18
1 files changed, 6 insertions, 12 deletions
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