From fe673bca7271fb901c4590affb395f6fba0ffd3d Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 24 Sep 2012 17:58:23 +0900 Subject: Conditional getModificationTime --- src/Hakyll/Core/Resource/Provider/File.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Hakyll/Core/Resource') 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 -- cgit v1.2.3