aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/unpublish.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-12-13 18:53:02 -0800
committerisaacs <i@izs.me>2011-12-14 14:17:16 -0800
commitbb9316da28feaad035eb2f61aeafc5f1a7a57ae2 (patch)
tree2ee858b80a3819c3c1d10c96932637261f5f0ca2 /deps/npm/lib/unpublish.js
parentf490934c33bdf134cfb24c6f26975a7e26d64953 (diff)
downloadandroid-node-v8-bb9316da28feaad035eb2f61aeafc5f1a7a57ae2.tar.gz
android-node-v8-bb9316da28feaad035eb2f61aeafc5f1a7a57ae2.tar.bz2
android-node-v8-bb9316da28feaad035eb2f61aeafc5f1a7a57ae2.zip
npm 1.1.0-beta-2
Diffstat (limited to 'deps/npm/lib/unpublish.js')
-rw-r--r--deps/npm/lib/unpublish.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js
index 2945a7887f..b7f6cbec89 100644
--- a/deps/npm/lib/unpublish.js
+++ b/deps/npm/lib/unpublish.js
@@ -39,10 +39,19 @@ unpublish.completion = function (opts, cb) {
}
function unpublish (args, cb) {
+
+ if (args.length > 1) return cb(unpublish.usage)
+
var thing = args.length ? args.shift().split("@") : []
, project = thing.shift()
, version = thing.join("@")
+ if (!version && !npm.config.get("force")) {
+ return cb("Refusing to delete entire project.\n"
+ +"Run with --force to do this.\n"
+ +unpublish.usage)
+ }
+
if (!project || path.resolve(project) === npm.prefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.