summaryrefslogtreecommitdiff
path: root/lib/LintConfig.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LintConfig.hs')
-rw-r--r--lib/LintConfig.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/LintConfig.hs b/lib/LintConfig.hs
index 1e9e538..904d930 100644
--- a/lib/LintConfig.hs
+++ b/lib/LintConfig.hs
@@ -130,15 +130,18 @@ patch x y = to (gappend (from x) (from y))
patchConfig :: LintConfig Identity -> Maybe (LintConfig Maybe) -> LintConfig Identity
patchConfig config p = config'
- { configUriSchemas = M.adjust assemblysubst "world" $ configUriSchemas config'}
+ { configUriSchemas = ("world", assemblysubsts) : configUriSchemas config'}
where config' = case p of
Just p -> patch config p
Nothing -> config
- assemblysubst = \case
- DomainSubstitution subst scope ->
- DomainSubstitution (subst <> M.fromList generated) scope
- where generated = (\slug -> (slug, "/@/rc3_21/"<>slug)) <$> configAssemblies config'
- other -> other
+ assemblysubsts =
+ DomainSubstitution (M.fromList generated) scope
+ where generated = (\slug -> (slug, "/@/rc3_21/"<>slug)) <$> configAssemblies config'
+ scope = (\(DomainSubstitution _ s) -> s)
+ . snd . head
+ . filter ((==) "world" . fst)
+ $ configUriSchemas config'
+
instance (FromJSON (LintConfig a)) => Argument (LintConfig a) where
parseArgument str =