From d82850982cd9f3f35e2627c026a8cf6e372e39cf Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 18 Feb 2011 22:04:23 -0800 Subject: Closes GH-575 Add the --pre flag This allows publishing pre-release versions of a package, by telling the registry to suppress the auto-tagging feature. --- lib/utils/default-config.js | 1 + lib/utils/parse-args.js | 1 + lib/utils/registry/publish.js | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/utils/default-config.js b/lib/utils/default-config.js index 21a0b3818..210f83496 100644 --- a/lib/utils/default-config.js +++ b/lib/utils/default-config.js @@ -37,6 +37,7 @@ module.exports = , "node-version" : process.version , "onload-script" : false , outfd : stdio.stdoutFD + , pre: false , proxy : process.env.HTTP_PROXY || process.env.http_proxy || null , prune : undefined // if set to boolean false, then that means "never" , "rebuild-bundle" : true diff --git a/lib/utils/parse-args.js b/lib/utils/parse-args.js index 9a6b7f510..a316d05cf 100644 --- a/lib/utils/parse-args.js +++ b/lib/utils/parse-args.js @@ -38,6 +38,7 @@ exports.types = , "node-version" : String , "onload-script" : [false, String] , outfd : [Number, Stream] + , pre: Boolean , proxy : url , prune : Boolean , "rebuild-bundle" : Boolean diff --git a/lib/utils/registry/publish.js b/lib/utils/registry/publish.js index 19610c7f5..3f0c86147 100644 --- a/lib/utils/registry/publish.js +++ b/lib/utils/registry/publish.js @@ -59,6 +59,7 @@ function publish (data, cb) { return log.er(cb, "Failed PUT response "+(response && response.statusCode))(er) } var dataURI = encodeURIComponent(data.name)+"/"+encodeURIComponent(data.version) + if (npm.config.get("pre")) dataURI += "/-pre/true" PUT(dataURI, data, function (er) { if (er) { if (er.message.indexOf("conflict Document update conflict.") === 0) { -- cgit v1.2.3