diff options
| author | Joey Hess <joeyh@joeyh.name> | 2018-02-27 12:09:46 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2018-02-27 12:09:46 -0400 |
| commit | 3919fa183bce29d4fbdbdcc4bd780e462dd6700f (patch) | |
| tree | 1e549d69ec771d7f5505b94c93c5843bd44850fb /src/Propellor/Git.hs | |
| parent | 3e1d8b6b6cbbb4d9560fb0d2ea1aec22e5f19239 (diff) | |
| parent | 094a6419f7e5ddb0566e10ef4122306187dc00d7 (diff) | |
Merge branch 'master' into joeyconfig
Diffstat (limited to 'src/Propellor/Git.hs')
| -rw-r--r-- | src/Propellor/Git.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 10b88ddd..c446f67a 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -30,6 +30,10 @@ hasRemote remotename = catchDefaultIO False $ do rs <- lines <$> readProcess "git" ["remote"] return $ remotename `elem` rs +remoteUrl :: String -> IO (Maybe String) +remoteUrl remotename = catchDefaultIO Nothing $ headMaybe . lines + <$> readProcess "git" ["config", "remote." ++ remotename ++ ".url"] + hasGitRepo :: IO Bool hasGitRepo = doesFileExist ".git/HEAD" |
