summaryrefslogtreecommitdiff
path: root/lib/CheckDir.hs
diff options
context:
space:
mode:
authorstuebinm2021-11-10 23:21:15 +0100
committerstuebinm2021-11-10 23:21:15 +0100
commit1338e4a1c9f445e5384cdee3d65cf5a46ce03105 (patch)
treea9ad34982e98a7dad4a24bc6269021283bde0d06 /lib/CheckDir.hs
parent508f8885f6087f2c56b188cd0632a4fc39de0540 (diff)
copy map assets (and refuse if any are missing)
Diffstat (limited to '')
-rw-r--r--lib/CheckDir.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CheckDir.hs b/lib/CheckDir.hs
index 68bcefe..5540aae 100644
--- a/lib/CheckDir.hs
+++ b/lib/CheckDir.hs
@@ -6,7 +6,7 @@
{-# LANGUAGE TupleSections #-}
-- | Module that contains high-level checking for an entire directory
-module CheckDir (recursiveCheckDir, DirResult(..)) where
+module CheckDir (recursiveCheckDir, DirResult(..), resultIsFatal) where
import CheckMap (MapResult (mapresultProvides),
loadAndLintMap, mapresultDepends)
@@ -47,7 +47,7 @@ data DirResult = DirResult
, dirresultDeps :: [MissingDep]
-- ^ all dependencies to things outside this repository
, dirresultMissingAssets :: [MissingAsset]
- -- ^ local things that are referred to but missing
+ -- ^ entrypoints of maps which are referred to but missing
} deriving (Generic)
data MissingDep = MissingDep
@@ -57,6 +57,13 @@ data MissingDep = MissingDep
newtype MissingAsset = MissingAsset MissingDep
+
+resultIsFatal :: DirResult -> Bool
+resultIsFatal res =
+ not $ null (dirresultMissingAssets res)
+
+
+
instance ToJSON DirResult where
toJSON res = A.object
[ "missingDeps" .= dirresultDeps res