summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-08-30 09:36:15 +0900
committerJasper Van der Jeugt <m@jaspervdj.be>2012-08-30 09:36:15 +0900
commit178609cfd0c30f10f86d72b3938ea50733b46222 (patch)
tree752815e107d2878f56ad1161375421a515355b0f
parent5f52c737e69582ed58942516899331a7f160d5aa (diff)
downloadhakyll-178609cfd0c30f10f86d72b3938ea50733b46222.tar.gz
Run ./hakyll clean instead of just removing _cache
-rw-r--r--src/Hakyll/Core/Compiler.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index ea1cbbe..55eaff8 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -124,6 +124,7 @@ import Control.Monad.Trans (liftIO)
import Control.Monad.Error (throwError)
import Control.Category (Category, (.), id)
import Data.List (find)
+import System.Environment (getProgName)
import System.FilePath (takeExtension)
import Data.Binary (Binary)
@@ -305,6 +306,7 @@ cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
identifier <- castIdentifier . compilerIdentifier <$> ask
store <- compilerStore <$> ask
modified <- compilerResourceModified <$> ask
+ progName <- liftIO getProgName
report logger $ "Checking cache: " ++ if modified then "modified" else "OK"
if modified
then do v <- unCompilerM $ j $ fromIdentifier identifier
@@ -312,10 +314,11 @@ cached name (Compiler d j) = Compiler d $ const $ CompilerM $ do
return v
else do v <- liftIO $ storeGet store name identifier
case v of Found v' -> return v'
- _ -> throwError error'
+ _ -> throwError (error' progName)
where
- error' = "Hakyll.Core.Compiler.cached: Cache corrupt!"
- ++ " Try deleting the _cache folder."
+ error' progName =
+ "Hakyll.Core.Compiler.cached: Cache corrupt! " ++
+ "Try running: " ++ progName ++ " clean"
-- | Create an unsafe compiler from a function in IO
--