@@ -51,36 +51,34 @@ program
5151 . command ( '*' , null , { noHelp : true } )
5252 . action ( ( ) => program . help ( ) ) ;
5353
54- program . on ( 'verbose' , function ( ) {
55- logger . verbose = true ;
56- } ) ;
57-
5854program . parse ( process . argv ) ;
5955
6056if ( ! program . args . length ) {
6157 debug ( ) ;
6258}
6359
6460function debug ( ) {
65- buildOptions ( true ) . then ( ( opts ) => {
66- const runner = CodeRunner . debug ( opts ) ;
61+ buildOptions ( true )
62+ . then ( opts => {
63+ const runner = CodeRunner . debug ( opts ) ;
6764
68- function handleTermination ( ) {
69- logger . info ( 'Termination signal received. Shutting down.' ) ;
65+ function handleTermination ( ) {
66+ logger . info ( 'Termination signal received. Shutting down.' ) ;
7067
71- runner . stop ( ) . then ( exit , exitWithError ) ;
72- }
68+ runner . stop ( ) . then ( exit , exitWithError ) ;
69+ }
7370
74- process . on ( 'SIGINT' , handleTermination ) ;
75- process . on ( 'SIGTERM' , handleTermination ) ;
76- } , exitWithError ) ;
71+ process . on ( 'SIGINT' , handleTermination ) ;
72+ process . on ( 'SIGTERM' , handleTermination ) ;
73+ } )
74+ . catch ( exitWithError ) ;
7775}
7876
7977function cloud ( ) {
8078 logger . prefixed = true ;
8179
8280 buildOptions ( )
83- . then ( ( opts ) => {
81+ . then ( opts => {
8482 opts . driverHost = this . driverHost ;
8583 opts . driverPort = this . driverPort ;
8684 opts . driverRequestId = this . driverRequestId ;
@@ -98,9 +96,8 @@ function cloud() {
9896}
9997
10098function deploy ( ) {
101- buildOptions ( true )
102- . then ( ( opts ) => {
103- opts . keepZip = this . keepZip ;
99+ buildOptions ( true ) . then ( opts => {
100+ opts . keepZip = this . keepZip || opts . keepZip ;
104101
105102 return CodeRunner . deploy ( opts ) ;
106103 } )
@@ -133,6 +130,8 @@ function buildOptions(appIsRequired) {
133130 opts . backendless . msgBroker . port = program . msgBrokerPort || opts . backendless . msgBroker . port ;
134131 opts . backendless . repoPath = program . repoPath || opts . backendless . repoPath || DEFAULT_REPO_PATH ;
135132
133+ opts . verbose = logger . verbose = program . verbose || opts . verbose ;
134+
136135 if ( appIsRequired ) {
137136 opts . app = opts . app || { } ;
138137
0 commit comments