mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Only watch mtime for .hs, .lhs, .hsc for ~/.xmonad/lib
Previously xmonad would force a recompile due to the object files being too new, so only look at files which may contain haskell code.
This commit is contained in:
parent
ccb6ff92f2
commit
8d8cc8bcd8
@ -412,7 +412,7 @@ recompile force = io $ do
|
|||||||
err = base ++ ".errors"
|
err = base ++ ".errors"
|
||||||
src = base ++ ".hs"
|
src = base ++ ".hs"
|
||||||
lib = dir </> "lib"
|
lib = dir </> "lib"
|
||||||
libTs <- mapM getModTime =<< allFiles lib
|
libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
|
||||||
srcT <- getModTime src
|
srcT <- getModTime src
|
||||||
binT <- getModTime bin
|
binT <- getModTime bin
|
||||||
if (force || srcT > binT || any (binT<) libTs)
|
if (force || srcT > binT || any (binT<) libTs)
|
||||||
@ -440,6 +440,7 @@ recompile force = io $ do
|
|||||||
return (status == ExitSuccess)
|
return (status == ExitSuccess)
|
||||||
else return True
|
else return True
|
||||||
where getModTime f = catch (Just <$> getModificationTime f) (const $ return Nothing)
|
where getModTime f = catch (Just <$> getModificationTime f) (const $ return Nothing)
|
||||||
|
isSource = flip elem [".hs",".lhs",".hsc"]
|
||||||
allFiles t = do
|
allFiles t = do
|
||||||
let prep = map (t</>) . Prelude.filter (`notElem` [".",".."])
|
let prep = map (t</>) . Prelude.filter (`notElem` [".",".."])
|
||||||
cs <- prep <$> catch (getDirectoryContents t) (\_ -> return [])
|
cs <- prep <$> catch (getDirectoryContents t) (\_ -> return [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user