Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-05-03 05:04:41 +0400
committerisaacs <i@izs.me>2010-05-03 05:07:52 +0400
commit95e5824ec2d18805f9a8434adf79288aa15edaed (patch)
tree85d94d7d08ae69fe1b92595e3ee92be01c754467 /lib
parent53b275faee0feea93a613f0eba5f847e9de29654 (diff)
Allow build to take an array of paths, and build them all.
Diffstat (limited to 'lib')
-rw-r--r--lib/build.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/build.js b/lib/build.js
index 356f2ac4e..90ec1761a 100644
--- a/lib/build.js
+++ b/lib/build.js
@@ -26,6 +26,15 @@ module.exports = build
// pkg is either a "package" folder, or a package.json data obj, or an
// object that has the package.json data on the _data member.
function build (args, cb) {
+ if (args.length > 1) {
+ ;(function B (p) {
+ if (!p) return cb()
+ build([p], function (er, ok) {
+ if (er) return cb(er)
+ B(args.shift())
+ })
+ })(args.shift())
+ }
var pkg = args[0]
// if pkg isn't an object, then parse the package.json inside it, and build with that.