@@ -41,6 +41,7 @@ import qualified Data.Text.Lazy.Encoding as TL
4141
4242import Control.Category ((>>>))
4343import Control.Arrow ((***))
44+import Control.Applicative ((<|>))
4445import Control.Exception (catch, try)
4546import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
4647import Control.Monad.Trans.Except
@@ -197,7 +198,7 @@ getBowerInfo = either (userError . BadRepositoryField) return . tryExtract
197198
198199extractGithub :: String -> Maybe (D.GithubUser, D.GithubRepo)
199200extractGithub =
200− stripPrefix "git://github.com/"
201+ matchUrl
201202 >>> fmap (splitOn "/")
202203 >=> takeTwo
203204 >>> fmap (D.GithubUser *** (D.GithubRepo . dropDotGit))
@@ -212,6 +213,10 @@ extractGithub =
212213 | ".git" `isSuffixOf` str = take (length str - 4) str
213214 | otherwise = str
214215
216+ matchUrl :: String -> Maybe String
217+ matchUrl str =
218+ stripPrefix "git@github.com:" str <|> stripPrefix "git://github.com/" str
219+
215220readProcess' :: String -> [String] -> String -> PrepareM String
216221readProcess' prog args stdin = do
217222 out <- liftIO (catch (Right <$> readProcess prog args stdin)