diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-06-27 09:49:22 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-07-02 05:49:46 +0400 |
commit | cf9bf56272d8d3cb90f87ef27bf17b8c23105422 (patch) | |
tree | e3e65de6871ea25a004ec334041aa4751bbdfb27 /lib | |
parent | 3fb6b7288a94e84f330b41580d0bb81143228f4e (diff) |
fix order dependency in remote git caching
Also add more logging.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache.js | 5 | ||||
-rw-r--r-- | lib/cache/add-remote-git.js | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/cache.js b/lib/cache.js index 3585a2e25..08f2c9165 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -254,7 +254,10 @@ function add (args, cb) { // short-circuit local installs fs.stat(spec, function (er) { - if (!er) return addLocal(spec, null, cb) + if (!er) { + log.verbose("cache add", "local package", path.resolve(spec)) + return addLocal(spec, null, cb) + } var p = npa(spec) log.verbose("parsed spec", p) diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index da0d1fd2f..fb9089bfd 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -40,6 +40,10 @@ module.exports = function addRemoteGit (u, silent, cb_) { if (!cb_) return + log.verbose("addRemoteGit", "u=%j silent=%j", u, silent) + var parsed = url.parse(u, true) + log.silly("addRemoteGit", "parsed", parsed) + // git is so tricky! // if the path is like ssh://foo:22/some/path then it works, but // it needs the ssh:// @@ -50,7 +54,6 @@ module.exports = function addRemoteGit (u, silent, cb_) { .replace(/#.*$/, "") // ssh paths that are scp-style urls don't need the ssh:// - var parsed = url.parse(u) if (parsed.pathname.match(/^\/?:/)) { u = u.replace(/^ssh:\/\//, "") } |