diff options
Diffstat (limited to 'deps/npm/lib/unpublish.js')
-rw-r--r-- | deps/npm/lib/unpublish.js | 9 |
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. |