git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1752 from codedmart/1549
08aeed2Phil Freeman
CONTRIBUTORS.md+1
@@ -60,6 +60,7 @@ This file lists the contributors to the PureScript compiler project, and the ter
60<http://opensource.org/licenses/MIT>.
60<http://opensource.org/licenses/MIT>.
61- [@soupi](https://github.com/soupi) (Gil Mizrahi) My existing contributions and all future contributions until further notice are Copyright Gil Mizrahi, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
61- [@soupi](https://github.com/soupi) (Gil Mizrahi) My existing contributions and all future contributions until further notice are Copyright Gil Mizrahi, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
62- [@tfausak](https://github.com/tfausak) (Taylor Fausak) My existing contributions and all future contributions until further notice are Copyright Taylor Fausak, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
62- [@tfausak](https://github.com/tfausak) (Taylor Fausak) My existing contributions and all future contributions until further notice are Copyright Taylor Fausak, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
63+- [@codedmart](https://github.com/codedmart) (Brandon Martin) My existing contributions and all future contributions until further notice are Copyright Brandon Martin, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
63
64
64### Companies
65### Companies
65
66
src/Language/PureScript/Publish.hs+6−1
@@ -41,6 +41,7 @@ import qualified Data.Text.Lazy.Encoding as TL
41
41
42import Control.Category ((>>>))
42import Control.Category ((>>>))
43import Control.Arrow ((***))
43import Control.Arrow ((***))
44+import Control.Applicative ((<|>))
44import Control.Exception (catch, try)
45import Control.Exception (catch, try)
45import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
46import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
46import Control.Monad.Trans.Except
47import Control.Monad.Trans.Except
@@ -197,7 +198,7 @@ getBowerInfo = either (userError . BadRepositoryField) return . tryExtract
197
198
198extractGithub :: String -> Maybe (D.GithubUser, D.GithubRepo)
199extractGithub :: String -> Maybe (D.GithubUser, D.GithubRepo)
199extractGithub =
200extractGithub =
200− stripPrefix "git://github.com/"
201+ matchUrl
201 >>> fmap (splitOn "/")
202 >>> fmap (splitOn "/")
202 >=> takeTwo
203 >=> takeTwo
203 >>> fmap (D.GithubUser *** (D.GithubRepo . dropDotGit))
204 >>> fmap (D.GithubUser *** (D.GithubRepo . dropDotGit))
@@ -212,6 +213,10 @@ extractGithub =
212 | ".git" `isSuffixOf` str = take (length str - 4) str
213 | ".git" `isSuffixOf` str = take (length str - 4) str
213 | otherwise = str
214 | otherwise = str
214
215
216+ matchUrl :: String -> Maybe String
217+ matchUrl str =
218+ stripPrefix "git@github.com:" str <|> stripPrefix "git://github.com/" str
219+
215readProcess' :: String -> [String] -> String -> PrepareM String
220readProcess' :: String -> [String] -> String -> PrepareM String
216readProcess' prog args stdin = do
221readProcess' prog args stdin = do
217 out <- liftIO (catch (Right <$> readProcess prog args stdin)
222 out <- liftIO (catch (Right <$> readProcess prog args stdin)