add back lost check that git-annex-shell supports gcrypt

This commit is contained in:
Joey Hess 2013-09-24 17:51:12 -04:00
parent b6b461992e
commit 3192b059b5
3 changed files with 38 additions and 13 deletions

View file

@ -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