Permalink
Browse files

Closes GH-552 Add 'private' flag to prevent publishing.

  • Loading branch information...
1 parent 937fac8 commit 2efd06506e8174c41e7c58317a93ec8138ecdc75 @isaacs isaacs committed Feb 2, 2011
Showing with 7 additions and 0 deletions.
  1. +3 −0 lib/publish.js
  2. +4 −0 test/packages/private/package.json
View
@@ -18,6 +18,9 @@ function publish (args, isRetry, cb) {
log.silly(data, "publish")
if (!data) return cb(new Error("no package.json file found"))
delete data.modules
+ if (data.private) return cb(new Error
+ ("This package has been marked as private\n"
+ +"Remove the 'private' field from the package.json to publish it."))
rpub(data, function (er) {
if (er && er.errno === npm.EPUBLISHCONFLICT
&& npm.config.get("force") && !isRetry) {
@@ -0,0 +1,4 @@
+{"name":"private"
+,"version":"9.9.9-9"
+,"homepage":"http://www.youtube.com/watch?v=1MLry6Cn_D4"
+,"private":"true"}

0 comments on commit 2efd065

Please sign in to comment.