Skip to content

Commit

Permalink
unionmount 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soficshift committed May 10, 2024
1 parent 4032914 commit ae516e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
packages: .

source-repository-package
type: git
location: https://github.com/lucasvreis/lvar.git
tag: b92b8c3d804b83c0b516f23f2b4486d119a24a50

source-repository-package
type: git
location: https://github.com/srid/unionmount.git
tag: fb401ce6030e0f516ea105e1f5c400260b3ade33
9 changes: 5 additions & 4 deletions src/Ondim/Loading.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ loadTemplatesDynamic ::
(MonadLogger m, MonadIO m, MonadUnliftIO m) =>
-- | Loading configurations
[LoadConfig n] ->
-- | Places to look for templates, in descending order of priority.
[FilePath] ->
-- | Places to look for templates and their (optional) mount point,
-- in descending order of priority.
[(FilePath, Maybe FilePath)] ->
m (OndimState n, (OndimState n -> m ()) -> m ())
loadTemplatesDynamic cfgs places =
let sources = fromList (zip (zip [1 ..] places) places)
let sources = fromList (zip (zip [1 ..] (fst <$> places)) places)
cfgMap = fromList $ [(i, f) | (i, loadFn -> f) <- zip [1 ..] cfgs]
patts = [(i, p) | (i, patterns -> ps) <- zip [1 ..] cfgs, p <- ps]
exclude = []
Expand All @@ -103,7 +104,7 @@ loadTemplatesDynamic cfgs places =
in unionMount sources patts exclude initial handler

-- | Load templates from a list of directories in descending order of priority.
loadTemplates :: [LoadConfig n] -> [FilePath] -> IO (OndimState n)
loadTemplates :: [LoadConfig n] -> [(FilePath, Maybe FilePath)] -> IO (OndimState n)
loadTemplates cfgs dirs = fst <$> runNoLoggingT (loadTemplatesDynamic cfgs dirs)

{- | Load templates in pure code from a list of filepaths and bytestrings. Meant
Expand Down

0 comments on commit ae516e8

Please sign in to comment.