From ea71fd67e84879d891e633c5deed085f52f4c289 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 19 Nov 2007 03:00:57 +0000 Subject: [PATCH] handle case of xmonad binary not existing, when checking recompilation --- XMonad/Core.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMonad/Core.hs b/XMonad/Core.hs index 80006b8..d533bf6 100644 --- a/XMonad/Core.hs +++ b/XMonad/Core.hs @@ -312,8 +312,8 @@ recompile = do yes <- doesFileExist src when yes $ do srcT <- getModificationTime src - binT <- getModificationTime bin - when (srcT > binT) $ do + binT <- catch (getModificationTime bin) (const $ return srcT) -- needs recompiling + when (srcT >= binT) $ do status <- bracket (openFile err WriteMode) hClose $ \h -> do waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-v0"] (Just dir) Nothing Nothing Nothing (Just h)