@@ -7,6 +7,7 @@ module Hakyll.Core.Compiler
7 , getIdentifier
7 , getIdentifier
9 , getResourceString
9 , getResourceString
11 , requireAll
12 , requireAll
@@ -82,6 +83,11 @@ getDependency identifier = CompilerM $ do
82 ++ show identifier
83 ++ show identifier
83 ++ " not found in the cache, the cache might be corrupted"
84 ++ " not found in the cache, the cache might be corrupted"
86+-- | Wait until another compiler has finished before running this compiler
88+waitFor :: Identifier -> Compiler a a
89+waitFor = fromDependencies . const . return
85-- | Require another target. Using this function ensures automatic handling of
91-- | Require another target. Using this function ensures automatic handling of
86-- dependencies
92-- dependencies
@@ -90,7 +96,7 @@ require :: (Binary a, Typeable a, Writable a)
90 -> (b -> a -> c)
96 -> (b -> a -> c)
91 -> Compiler b c
97 -> Compiler b c
92require identifier f =
98require identifier f =
93− fromDependencies (const [identifier]) >>> fromJob require'
99+ waitFor identifier >>> fromJob require'
95 require' x = do
101 require' x = do
96 y <- getDependency identifier
102 y <- getDependency identifier