Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-06-27 09:49:22 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-07-02 05:49:46 +0400
commitcf9bf56272d8d3cb90f87ef27bf17b8c23105422 (patch)
treee3e65de6871ea25a004ec334041aa4751bbdfb27 /lib
parent3fb6b7288a94e84f330b41580d0bb81143228f4e (diff)
fix order dependency in remote git caching
Also add more logging.
Diffstat (limited to 'lib')
-rw-r--r--lib/cache.js5
-rw-r--r--lib/cache/add-remote-git.js5
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:\/\//, "")
}