avoid crash on no propellor.debug setting
This commit is contained in:
parent
e07dc9b1d3
commit
5a104675e4
|
@ -18,6 +18,7 @@ import Propellor.Types
|
||||||
import Utility.Monad
|
import Utility.Monad
|
||||||
import Utility.Env
|
import Utility.Env
|
||||||
import Utility.Process
|
import Utility.Process
|
||||||
|
import Utility.Exception
|
||||||
|
|
||||||
data MessageHandle
|
data MessageHandle
|
||||||
= ConsoleMessageHandle
|
= ConsoleMessageHandle
|
||||||
|
@ -113,7 +114,8 @@ checkDebugMode = go =<< getEnv "PROPELLOR_DEBUG"
|
||||||
go Nothing = whenM (doesDirectoryExist ".git") $
|
go Nothing = whenM (doesDirectoryExist ".git") $
|
||||||
whenM (any (== "1") . lines <$> getgitconfig) $
|
whenM (any (== "1") . lines <$> getgitconfig) $
|
||||||
enableDebugMode
|
enableDebugMode
|
||||||
getgitconfig = readProcess "git" ["config", "propellor.debug"]
|
getgitconfig = catchDefaultIO "" $
|
||||||
|
readProcess "git" ["config", "propellor.debug"]
|
||||||
|
|
||||||
enableDebugMode :: IO ()
|
enableDebugMode :: IO ()
|
||||||
enableDebugMode = do
|
enableDebugMode = do
|
||||||
|
|
Loading…
Reference in New Issue