handle case of xmonad binary not existing, when checking recompilation

This commit is contained in:
Don Stewart
2007-11-19 03:00:57 +00:00
parent e9eadd6141
commit ea71fd67e8

View File

@@ -312,8 +312,8 @@ recompile = do
yes <- doesFileExist src yes <- doesFileExist src
when yes $ do when yes $ do
srcT <- getModificationTime src srcT <- getModificationTime src
binT <- getModificationTime bin binT <- catch (getModificationTime bin) (const $ return srcT) -- needs recompiling
when (srcT > binT) $ do when (srcT >= binT) $ do
status <- bracket (openFile err WriteMode) hClose $ \h -> do status <- bracket (openFile err WriteMode) hClose $ \h -> do
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-v0"] (Just dir) waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-v0"] (Just dir)
Nothing Nothing Nothing (Just h) Nothing Nothing Nothing (Just h)