Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
hosted-git-info@1.5.3
Browse files Browse the repository at this point in the history
Use `hosted-git-info` directly to ensure that all GitHub URLs are being
run through the same cloning strategy for caching. Fixes #7630.
  • Loading branch information
othiym23 committed Mar 20, 2015
1 parent 63313eb commit 89ce829
Show file tree
Hide file tree
Showing 34 changed files with 13 additions and 1,370 deletions.
17 changes: 9 additions & 8 deletions lib/cache/maybe-github.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
var assert = require("assert")
, log = require("npmlog")
, addRemoteGit = require("./add-remote-git.js")
, hosted = require("hosted-git-info")

module.exports = function maybeGithub (p, cb) {
assert(typeof p === "string", "must pass package name")
assert(typeof cb === "function", "must pass callback")

var u = "git://github.com/" + p
log.info("maybeGithub", "Attempting %s from %s", p, u)
var parsed = hosted.fromUrl(p)
log.info("maybeGithub", "Attempting %s from %s", p, parsed.git())

return addRemoteGit(u, true, function (er, data) {
return addRemoteGit(parsed.git(), true, function (er, data) {
if (er) {
var upriv = "ssh://git@github.com:" + p
log.info("maybeGithub", "Attempting %s from %s", p, upriv)
log.info("maybeGithub", "Couldn't clone %s", parsed.git())
log.info("maybeGithub", "Now attempting %s from %s", p, parsed.ssh())

return addRemoteGit(upriv, false, function (er, data) {
return addRemoteGit(parsed.ssh(), false, function (er, data) {
if (er) return cb(er)

success(upriv, data)
success(parsed.ssh(), data)
})
}

success(u, data)
success(parsed.git(), data)
})

function success (u, data) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 89ce829

Please sign in to comment.