aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Distribution')
-rw-r--r--lib/Distribution/Helper.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index e98427e..97670de 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -196,12 +196,19 @@ getProjConfModTime ProjConfV1{pcV1CabalFile} =
fmap ProjConfModTimes $ mapM getFileModTime
[ pcV1CabalFile
]
-getProjConfModTime ProjConfV2{..} =
- fmap ProjConfModTimes $ mapM getFileModTime
+getProjConfModTime ProjConfV2{..} = do
+ mandatory <- mapM getFileModTime $
[ pcV2CabalProjFile
- , pcV2CabalProjLocalFile
+ ]
+ optional <- mapM (traverse getFileModTime <=< mightExist)
+ [ pcV2CabalProjLocalFile
, pcV2CabalProjFreezeFile
]
+ return $
+ ProjConfModTimes $
+ mandatory ++
+ catMaybes optional
+
getProjConfModTime ProjConfStack{..} =
fmap ProjConfModTimes $ mapM getFileModTime
[ pcStackYaml