From de3da0b826cec4819bd4b2d83f1a116445efd91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20von=20der=20Gr=C3=BCn?= Date: Thu, 30 Aug 2018 20:59:51 +0200 Subject: [PATCH] Remove callback parameter of main CLI function Resolves #314 --- src/cli.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/cli.js b/src/cli.js index 718b127fa..94efe5284 100644 --- a/src/cli.js +++ b/src/cli.js @@ -96,12 +96,7 @@ function checkForUpdates () { var shouldCollectTelemetry = false; -module.exports = function (inputArgs, cb) { - /** - * mainly used for testing. - */ - cb = cb || function () {}; - +module.exports = function (inputArgs) { // If no inputArgs given, use process.argv. inputArgs = inputArgs || process.argv; var cmd = inputArgs[2]; // e.g: inputArgs= 'node cordova run ios' @@ -205,14 +200,10 @@ module.exports = function (inputArgs, cb) { if (shouldCollectTelemetry && !isTelemetryCmd) { telemetry.track(cmd, subcommand, 'successful'); } - // call cb with error as arg if something failed - cb(null); }).catch(function (err) { if (shouldCollectTelemetry && !isTelemetryCmd) { telemetry.track(cmd, subcommand, 'unsuccessful'); } - // call cb with error as arg if something failed - cb(err); throw err; }); };