fall back to previous ~/.xmonad/xmonad if recompilation fails

This commit is contained in:
Lukas Mai 2007-11-07 01:53:09 +00:00
parent ece268cd1e
commit 94924123bb

View File

@ -22,7 +22,6 @@ import System.IO
import System.Process import System.Process
import System.Directory import System.Directory
import System.Environment import System.Environment
import System.Exit
import System.Posix.Process (executeFile) import System.Posix.Process (executeFile)
-- | The entry point into xmonad. Attempts to compile any custom main -- | The entry point into xmonad. Attempts to compile any custom main
@ -47,7 +46,7 @@ buildLaunch = do
dir <- fmap (++ "/.xmonad") getHomeDirectory dir <- fmap (++ "/.xmonad") getHomeDirectory
pid <- runProcess "ghc" ["--make", "xmonad.hs"] (Just dir) pid <- runProcess "ghc" ["--make", "xmonad.hs"] (Just dir)
Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
ExitSuccess <- waitForProcess pid waitForProcess pid
args <- getArgs args <- getArgs
executeFile (dir ++ "/xmonad") False args Nothing executeFile (dir ++ "/xmonad") False args Nothing
return () return ()