add runBool
This commit is contained in:
parent
2e5c8ca6bf
commit
ae2be332d4
1 changed files with 7 additions and 1 deletions
|
@ -37,6 +37,7 @@ module GitRepo (
|
||||||
configTrue,
|
configTrue,
|
||||||
gitCommandLine,
|
gitCommandLine,
|
||||||
run,
|
run,
|
||||||
|
runBool,
|
||||||
pipeRead,
|
pipeRead,
|
||||||
pipeWrite,
|
pipeWrite,
|
||||||
pipeWriteRead,
|
pipeWriteRead,
|
||||||
|
@ -350,10 +351,15 @@ gitCommandLine repo@(Repo { location = Dir d} ) params =
|
||||||
] ++ params
|
] ++ params
|
||||||
gitCommandLine repo _ = assertLocal repo $ error "internal"
|
gitCommandLine repo _ = assertLocal repo $ error "internal"
|
||||||
|
|
||||||
|
{- Runs git in the specified repo. -}
|
||||||
|
runBool :: Repo -> String -> [CommandParam] -> IO Bool
|
||||||
|
runBool repo subcommand params = assertLocal repo $
|
||||||
|
boolSystem "git" (gitCommandLine repo ((Param subcommand):params))
|
||||||
|
|
||||||
{- Runs git in the specified repo, throwing an error if it fails. -}
|
{- Runs git in the specified repo, throwing an error if it fails. -}
|
||||||
run :: Repo -> String -> [CommandParam] -> IO ()
|
run :: Repo -> String -> [CommandParam] -> IO ()
|
||||||
run repo subcommand params = assertLocal repo $
|
run repo subcommand params = assertLocal repo $
|
||||||
boolSystem "git" (gitCommandLine repo ((Param subcommand):params))
|
runBool repo subcommand params
|
||||||
>>! error $ "git " ++ show params ++ " failed"
|
>>! error $ "git " ++ show params ++ " failed"
|
||||||
|
|
||||||
{- Runs a git subcommand and returns its output, lazily.
|
{- Runs a git subcommand and returns its output, lazily.
|
||||||
|
|
Loading…
Reference in a new issue