Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove callback parameter of main CLI function #316

Merged
merged 1 commit into from
Sep 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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