File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323const url = require ( 'url' ) ;
2424const path = require ( 'path' ) ;
2525
26- const Q = require ( 'q' ) ;
2726const nopt = require ( 'nopt' ) ;
2827
2928const pkg = require ( './package' ) ;
@@ -63,14 +62,7 @@ if (cli_opts.plugins_dir || cli_opts.project) {
6362 path . join ( cli_opts . project , 'cordova' , 'plugins' ) ;
6463}
6564
66- process . on ( 'uncaughtException' , function ( error ) {
67- if ( cli_opts . debug ) {
68- console . error ( error . message , error . stack ) ;
69- } else {
70- console . error ( error . message ) ;
71- }
72- process . exit ( 1 ) ;
73- } ) ;
65+ process . on ( 'uncaughtException' , fail ) ;
7466
7567// Set up appropriate logging based on events
7668if ( cli_opts . debug ) {
@@ -90,10 +82,16 @@ if (cli_opts.version) {
9082} else if ( cli_opts . help ) {
9183 console . log ( help ( ) ) ;
9284} else if ( plugman . commands [ cmd ] ) {
93- var result = plugman . commands [ cmd ] ( cli_opts ) ;
94- if ( result && Q . isPromise ( result ) ) {
95- result . done ( ) ;
96- }
85+ Promise . resolve ( plugman . commands [ cmd ] ( cli_opts ) )
86+ . catch ( fail ) ;
9787} else {
9888 console . log ( help ( ) ) ;
9989}
90+
91+ function fail ( error ) {
92+ console . error ( error . message ) ;
93+ if ( cli_opts . debug ) {
94+ console . error ( error . stack ) ;
95+ }
96+ process . exit ( 1 ) ;
97+ }
Original file line number Diff line number Diff line change 1818 "engineStrict" : true ,
1919 "dependencies" : {
2020 "cordova-lib" : " 8.0.0" ,
21- "nopt" : " 1.0.9" ,
22- "q" : " 1.0.1"
21+ "nopt" : " 1.0.9"
2322 },
2423 "devDependencies" : {
2524 "eslint" : " ^4.2.0" ,
You can’t perform that action at this time.
0 commit comments