Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make maybeModTime always use UTCTime, regardless of GHC/directory versions #16

Merged
merged 1 commit into from Feb 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Config/Dyre/Paths.hs
Expand Up @@ -6,6 +6,7 @@ import System.Directory (getCurrentDirectory, doesFileExist, getMo
import System.Environment.XDG.BaseDir (getUserCacheDir, getUserConfigDir) import System.Environment.XDG.BaseDir (getUserCacheDir, getUserConfigDir)
import System.Environment.Executable (getExecutablePath) import System.Environment.Executable (getExecutablePath)
import Data.Time import Data.Time
import Data.Time.Compat


import Config.Dyre.Params import Config.Dyre.Params
import Config.Dyre.Options import Config.Dyre.Options
Expand Down Expand Up @@ -33,10 +34,9 @@ getPaths params@Params{projectName = pName} = do


-- | Check if a file exists. If it exists, return Just the modification -- | Check if a file exists. If it exists, return Just the modification
-- time. If it doesn't exist, return Nothing. -- time. If it doesn't exist, return Nothing.
maybeModTime :: FilePath -> IO (Maybe UTCTime)
maybeModTime path = do maybeModTime path = do
fileExists <- doesFileExist path fileExists <- doesFileExist path
if fileExists if fileExists
then fmap Just $ getModificationTime path then fmap (Just . toUTCTime) $ getModificationTime path
else return Nothing else return Nothing
-- Removed type signature because it can't satisfy GHC 7.4 and 7.6 at once
-- maybeModTime :: FilePath -> IO (Maybe UTCTime)
2 changes: 1 addition & 1 deletion dyre.cabal
Expand Up @@ -42,7 +42,7 @@ library
Config.Dyre.Compile, Config.Dyre.Compile,
Config.Dyre.Relaunch Config.Dyre.Relaunch
build-depends: base >= 4 && < 5, process, filepath, build-depends: base >= 4 && < 5, process, filepath,
directory, ghc-paths, time, binary, directory, ghc-paths, time, time-compat, binary,
executable-path, xdg-basedir, io-storage executable-path, xdg-basedir, io-storage


if os(windows) if os(windows)
Expand Down