on master help sign in
Run ./hakyll clean instead of just removing _cache
178609cJasper Van der Jeugt
src/Hakyll/Core/Compiler.hs+6−3
@@ -124,6 +124,7 @@ import Control.Monad.Trans (liftIO)
124import Control.Monad.Error (throwError)
124import Control.Monad.Error (throwError)
125import Control.Category (Category, (.), id)
125import Control.Category (Category, (.), id)
126import Data.List (find)
126import Data.List (find)
127+import System.Environment (getProgName)
127import System.FilePath (takeExtension)
128import System.FilePath (takeExtension)
128
129
129import Data.Binary (Binary)
130import Data.Binary (Binary)
@@ -305,6 +306,7 @@ cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
305 identifier <- castIdentifier . compilerIdentifier <$> ask
306 identifier <- castIdentifier . compilerIdentifier <$> ask
306 store <- compilerStore <$> ask
307 store <- compilerStore <$> ask
307 modified <- compilerResourceModified <$> ask
308 modified <- compilerResourceModified <$> ask
309+ progName <- liftIO getProgName
308 report logger $ "Checking cache: " ++ if modified then "modified" else "OK"
310 report logger $ "Checking cache: " ++ if modified then "modified" else "OK"
309 if modified
311 if modified
310 then do v <- unCompilerM $ j $ fromIdentifier identifier
312 then do v <- unCompilerM $ j $ fromIdentifier identifier
@@ -312,10 +314,11 @@ cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
312 return v
314 return v
313 else do v <- liftIO $ storeGet store name identifier
315 else do v <- liftIO $ storeGet store name identifier
314 case v of Found v' -> return v'
316 case v of Found v' -> return v'
315− _ -> throwError error'
317+ _ -> throwError (error' progName)
316 where
318 where
319+ error' progName =
317− error' = "Hakyll.Core.Compiler.cached: Cache corrupt!"
320+ "Hakyll.Core.Compiler.cached: Cache corrupt! " ++
318− ++ " Try deleting the _cache folder."
321+ "Try running: " ++ progName ++ " clean"
319
322
320-- | Create an unsafe compiler from a function in IO
323-- | Create an unsafe compiler from a function in IO
321--
324--