diff --git a/bin/bower_new b/bin/bower_new index 1cb6cd3f..837ad450 100755 --- a/bin/bower_new +++ b/bin/bower_new @@ -13,6 +13,7 @@ var options; var renderer; var loglevel; var command; +var emitter; var notifier; var levels = { 'error': 5, @@ -56,11 +57,11 @@ if (!commands[command]) { } // Execute the command -command = commands[command].line(process.argv); +emitter = commands[command].line(process.argv); // Connect the command output to the renderer -renderer = cli.getRenderer(command.name, config); -command +renderer = cli.getRenderer(emitter.command, config); +emitter .on('end', function (data) { if (!config.silent) { renderer.end(data); diff --git a/lib/commands/help.js b/lib/commands/help.js index 92555ae7..a7f4f64e 100644 --- a/lib/commands/help.js +++ b/lib/commands/help.js @@ -15,7 +15,7 @@ function help(name) { emitter.emit('end', json); }); - emitter.name = 'help'; + emitter.command = 'help'; return emitter; } diff --git a/lib/commands/install.js b/lib/commands/install.js index 2dcfb0c0..9968b0eb 100644 --- a/lib/commands/install.js +++ b/lib/commands/install.js @@ -27,7 +27,7 @@ function install(endpoints, options, config) { emitter.emit('notification', notification); }); - emitter.name = 'install'; + emitter.command = 'install'; return emitter; } diff --git a/lib/commands/uninstall.js b/lib/commands/uninstall.js index 09702b32..c644bd21 100644 --- a/lib/commands/uninstall.js +++ b/lib/commands/uninstall.js @@ -27,7 +27,7 @@ function uninstall(endpoints, options, config) { emitter.emit('notification', notification); }); - emitter.name = 'uninstall'; + emitter.command = 'uninstall'; return emitter; } diff --git a/lib/commands/update.js b/lib/commands/update.js index b07039f0..c81bfe30 100644 --- a/lib/commands/update.js +++ b/lib/commands/update.js @@ -27,7 +27,7 @@ function update(endpoints, options, config) { emitter.emit('notification', notification); }); - emitter.name = 'update'; + emitter.command = 'update'; return emitter; } diff --git a/lib/renderers/StandardRenderer.js b/lib/renderers/StandardRenderer.js index 45f96bbd..06c1a33c 100644 --- a/lib/renderers/StandardRenderer.js +++ b/lib/renderers/StandardRenderer.js @@ -76,7 +76,11 @@ StandardRenderer.prototype.updateNotice = function (data) { // ------------------------- StandardRenderer.prototype._install = function (installed) { - // TODO + // TODO: render tree of installed packages +}; + +StandardRenderer.prototype._update = function (updated) { + // TODO: render tree of updated packages }; StandardRenderer.prototype._help = function (data) { @@ -93,7 +97,7 @@ StandardRenderer.prototype._help = function (data) { .then(function (str) { that._write(process.stdout, str); }, function (err) { - // If it failed with something else than ENOENTm + // If it failed with something else than ENOENT // error out if (err.code !== 'ENOENT') { return err; diff --git a/templates/json/help.json b/templates/json/help.json index da7fb97f..342ce71a 100644 --- a/templates/json/help.json +++ b/templates/json/help.json @@ -26,7 +26,7 @@ { "shorthand": "-j", "flag": "--json", - "description": "Output consumable JSON output" + "description": "Output consumable JSON" }, { "shorthand": "-l",