diff --git a/src/plugins/System/Plugins/Load.hs b/src/plugins/System/Plugins/Load.hs index 346e7ee..19fb54f 100644 --- a/src/plugins/System/Plugins/Load.hs +++ b/src/plugins/System/Plugins/Load.hs @@ -372,16 +372,18 @@ hasChanged = hasChanged' ["hs","lhs"] hasChanged' :: [String] -> Module -> IO Bool hasChanged' suffices m@(Module {path = p}) - = do mbFile <- findFile suffices p + = do modFile <- doesFileExist p + mbFile <- findFile suffices p case mbFile of - Nothing -> return False - Just f -> do srcT <- getModificationTime f - objT <- getModificationTime p - if srcT > objT - then return True - else do deps <- getModuleDeps m - depsStatus <- mapM (hasChanged' suffices) deps - return (or depsStatus) + Just f | modFile + -> do srcT <- getModificationTime f + objT <- getModificationTime p + if srcT > objT + then return True + else do deps <- getModuleDeps m + depsStatus <- mapM (hasChanged' suffices) deps + return (or depsStatus) + _ -> return False where findFile :: [String] -> FilePath -> IO (Maybe FilePath) findFile [] _ = return Nothing findFile (ext:exts) file