diff options
author | isaacs <i@izs.me> | 2011-10-13 04:35:53 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-13 04:35:53 +0400 |
commit | a496bd001f66e55056670b512d4837a8ca347f29 (patch) | |
tree | 6830b1f461f01be94d23ba940ba3ec629de1ee63 /lib | |
parent | 017817c9d449c5ab64f1d6d35f899d082d383a76 (diff) |
Close #1518 don't allow npm view .
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/config-defs.js | 3 | ||||
-rw-r--r-- | lib/view.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js index 0389eaf1b..2824080e0 100644 --- a/lib/utils/config-defs.js +++ b/lib/utils/config-defs.js @@ -58,6 +58,7 @@ if (!stableFamily || (+stableFamily[2] % 2)) stableFamily = null else stableFamily = stableFamily[1] + "." + stableFamily[2] var httpsOk = semver.satisfies(process.version, ">=0.4.9") +var winColor = semver.satisfies(process.version, ">=0.5.9") var defaults @@ -118,7 +119,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , cache : path.resolve( home || temp , process.platform === "win32" ? "npm-cache" : ".npm") - , color : process.platform !== "win32" + , color : process.platform !== "win32" || winColor , depth: Infinity , description : true , dev : false diff --git a/lib/view.js b/lib/view.js index ea39b3e32..266996306 100644 --- a/lib/view.js +++ b/lib/view.js @@ -55,6 +55,9 @@ function view (args, silent, cb) { , nv = pkg.split("@") , name = nv.shift() , version = nv.join("@") || npm.config.get("tag") + + if (name === ".") return cb(view.usage) + // get the data about this package registry.get(name, null, 600, function (er, data) { if (er) return cb(er) |