From 0dab06c92cfef9f46d2e99b9207dba97450d5953 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 6 Dec 2015 16:48:48 -0700 Subject: rewrite getRepoUrl with getGitConfigValue Signed-off-by: Sean Whitton (cherry picked from commit 3d4c34dece4d295a349ac5b24ec1fbbd3e90f668) --- src/Propellor/Git.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index e11528fa..a2f5aef2 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -51,16 +51,9 @@ getGitConfigBool key = do _ -> False getRepoUrl :: IO (Maybe String) -getRepoUrl = getM get urls +getRepoUrl = getM getGitConfigValue urls where urls = ["remote.deploy.url", "remote.origin.url"] - get u = do - v <- catchMaybeIO $ - takeWhile (/= '\n') - <$> readProcess "git" ["config", u] - return $ case v of - Just url | not (null url) -> Just url - _ -> Nothing hasOrigin :: IO Bool hasOrigin = catchDefaultIO False $ do -- cgit v1.2.3