Browse files

use the archives from GitHub.

Uses GitHub-provided tars instead of using git directly. This also makes
providing refs work for GitHub deps.
  • Loading branch information...
1 parent 3769fe2 commit 115d67d0dbbf4b3cab3ef5c2d93cb52a6e795f81 @nathan7 nathan7 committed with isaacs Dec 24, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/cache.js
View
10 lib/cache.js
@@ -664,10 +664,16 @@ function addLocal (p, name, cb_) {
}
function maybeGithub (p, name, er, cb) {
- var u = "git://github.com/" + p
+ var u = "https://github.com/" + p
, up = url.parse(u)
+ if (up.hash && up.hash[0] === "#")
+ up.hash = up.hash.slice(1)
+
+ var ref = encodeURIComponent(up.hash || "master")
+ up.pathname = path.join(up.pathname, "tarball", ref).replace(/\\/g, "/")
+ u = url.format(up)
log.info("maybeGithub", "Attempting to fetch %s from %s", p, u)
- return addRemoteGit(u, up, name, function (er2, data) {
+ return addRemoteTarball(u, null, name, function (er2, data) {
if (er2) return cb(er)
return cb(null, data)
})

0 comments on commit 115d67d

Please sign in to comment.