From b0f9a3d0b9e68e5252de41cc23920f911f60b960 Mon Sep 17 00:00:00 2001 From: Philipp Balzarek Date: Thu, 20 Oct 2016 19:33:44 +0200 Subject: [PATCH] clean up build-script handling --- src/XMonad/Core.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs index 8920031..a6387fd 100644 --- a/src/XMonad/Core.hs +++ b/src/XMonad/Core.hs @@ -467,11 +467,9 @@ recompile force = io $ do libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib useBuildscript <- do exists <- doesFileExist buildscript - if exists then do - permissions <- getPermissions buildscript - return $ executable permissions - else - return False + if exists + then executable <$> getPermissions buildscript + else return False srcT <- getModTime src binT <- getModTime bin buildScriptT <- getModTime buildscript @@ -528,7 +526,7 @@ recompile force = io $ do , "-o", binn ] (Just dir) Nothing Nothing Nothing (Just errHandle) compileScript binn dir script errHandle = - runProcess script [dir, binn] (Just dir) Nothing Nothing Nothing (Just errHandle) + runProcess script [binn] (Just dir) Nothing Nothing Nothing (Just errHandle) -- | Conditionally run an action, using a @Maybe a@ to decide. whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()