diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-09-24 17:58:23 +0900 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-09-24 17:58:23 +0900 |
commit | fe673bca7271fb901c4590affb395f6fba0ffd3d (patch) | |
tree | a7df9c4324e0e9ece9c0ade89b1e7af1217c8dd4 /src | |
parent | 50418117e73d0a2b8c51ec35ed26994cef3df3b2 (diff) | |
download | hakyll-fe673bca7271fb901c4590affb395f6fba0ffd3d.tar.gz |
Conditional getModificationTime
Diffstat (limited to 'src')
-rw-r--r-- | src/Hakyll/Core/Resource/Provider/File.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Resource/Provider/File.hs b/src/Hakyll/Core/Resource/Provider/File.hs index b2172b8..3a67817 100644 --- a/src/Hakyll/Core/Resource/Provider/File.hs +++ b/src/Hakyll/Core/Resource/Provider/File.hs @@ -1,5 +1,6 @@ -- | A concrete 'ResourceProvider' that gets it's resources from the filesystem -- +{-# LANGUAGE CPP #-} module Hakyll.Core.Resource.Provider.File ( fileResourceProvider ) where @@ -29,6 +30,10 @@ fileResourceProvider configuration = do (mtime . unResource) where mtime r = do +#if MIN_VERSION_directory(1,2,0) + getModificationTime r +#else ct <- toCalendarTime =<< getModificationTime r let str = formatCalendarTime defaultTimeLocale "%s" ct return $ readTime defaultTimeLocale "%s" str +#endif |