From 922898fe9b64766537a6d35e19e4d8c5f6bffbda Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 26 Apr 2011 08:23:41 +0200 Subject: output error code when xmonad.hs compile fails without any error output Ignore-this: 6249588a9d427a49fceb99d78a95c438 Currently if there is no ghc on the path say for some reason, xmonad.error is empty. This patch makes it output the exitcode code when the compile process fails without any error output. (It might be easier just to spawn a shell to get "ghc: command not found" output for free.) darcs-hash:20110426062341-2376b-eb9466e5933a53138d24b3492260a618c239acd3 --- XMonad/Core.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMonad/Core.hs b/XMonad/Core.hs index ba12455..8ec0000 100644 --- a/XMonad/Core.hs +++ b/XMonad/Core.hs @@ -464,7 +464,7 @@ recompile force = io $ do ghcErr <- readFile err let msg = unlines $ ["Error detected while loading xmonad configuration file: " ++ src] - ++ lines ghcErr ++ ["","Please check the file for errors."] + ++ lines (if (null ghcErr) then show status else ghcErr) ++ ["","Please check the file for errors."] -- nb, the ordering of printing, then forking, is crucial due to -- lazy evaluation hPutStrLn stderr msg -- cgit v1.2.3