From 4e9c87f80b40e8428613566a15b4c02033d9449b Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Wed, 1 Apr 2015 02:15:02 +0000 Subject: [PATCH] Execute npm install after installing a plugin --- package.json | 2 +- plugins/c9.cli.publish/publish.js | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 082baa81..9ec64936 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "c9.ide.find.infiles": "#1b83cf12f1", "c9.ide.find.replace": "#e4daf722b8", "c9.ide.run.debug": "#638e6b00b3", - "c9.automate": "#7e2612a88c", + "c9.automate": "#86bf1ee1ca", "c9.ide.ace.emmet": "#e5f1a92ac3", "c9.ide.ace.gotoline": "#4d1a93172c", "c9.ide.ace.keymaps": "#6c4bb65b1f", diff --git a/plugins/c9.cli.publish/publish.js b/plugins/c9.cli.publish/publish.js index 17ebcd32..02aefdc5 100644 --- a/plugins/c9.cli.publish/publish.js +++ b/plugins/c9.cli.publish/publish.js @@ -741,9 +741,27 @@ define(function(require, exports, module) { ? new Error("Failed to unpack package") : null; - // Done - callback(err, { - version: version + proc.spawn(join(process.env.HOME, ".c9/node/bin/npm"), { + args: ["install"], + cwd: packagePath + }, function(err, p){ + if (err) return callback(err); + + if (verbose) { + p.stdout.on("data", function(c){ + process.stdout.write(c.toString("utf8")); + }); + p.stderr.on("data", function(c){ + process.stderr.write(c.toString("utf8")); + }); + } + + p.on("exit", function(code){ + // Done + callback(err, { + version: version + }); + }); }); }); });