add back lost check that git-annex-shell supports gcrypt
This commit is contained in:
parent
b6b461992e
commit
3192b059b5
3 changed files with 38 additions and 13 deletions
|
@ -10,6 +10,7 @@ module Git.Config where
|
|||
import qualified Data.Map as M
|
||||
import Data.Char
|
||||
import System.Process (cwd, env)
|
||||
import Control.Exception.Extensible
|
||||
|
||||
import Common
|
||||
import Git
|
||||
|
@ -153,3 +154,17 @@ boolConfig False = "false"
|
|||
|
||||
isBare :: Repo -> Bool
|
||||
isBare r = fromMaybe False $ isTrue =<< getMaybe "core.bare" r
|
||||
|
||||
{- Runs a command to get the configuration of a repo,
|
||||
- and returns a repo populated with the configuration, as well as the raw
|
||||
- output of the command. -}
|
||||
fromPipe :: Repo -> String -> [CommandParam] -> IO (Either SomeException (Repo, String))
|
||||
fromPipe r cmd params = try $
|
||||
withHandle StdoutHandle createProcessSuccess p $ \h -> do
|
||||
fileEncoding h
|
||||
val <- hGetContentsStrict h
|
||||
r' <- store val r
|
||||
return (r', val)
|
||||
where
|
||||
p = proc cmd $ toCommand params
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue