Skip to content

Commit

Permalink
Remove callback parameter of main CLI function
Browse files Browse the repository at this point in the history
Resolves #314
  • Loading branch information
raphinesse committed Aug 31, 2018
1 parent 2d92035 commit de3da0b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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;
});
};
Expand Down

0 comments on commit de3da0b

Please sign in to comment.