@@ -51,36 +51,34 @@ program
51
51
. command ( '*' , null , { noHelp : true } )
52
52
. action ( ( ) => program . help ( ) ) ;
53
53
54
- program . on ( 'verbose' , function ( ) {
55
- logger . verbose = true ;
56
- } ) ;
57
-
58
54
program . parse ( process . argv ) ;
59
55
60
56
if ( ! program . args . length ) {
61
57
debug ( ) ;
62
58
}
63
59
64
60
function debug ( ) {
65
- buildOptions ( true ) . then ( ( opts ) => {
66
- const runner = CodeRunner . debug ( opts ) ;
61
+ buildOptions ( true )
62
+ . then ( opts => {
63
+ const runner = CodeRunner . debug ( opts ) ;
67
64
68
- function handleTermination ( ) {
69
- logger . info ( 'Termination signal received. Shutting down.' ) ;
65
+ function handleTermination ( ) {
66
+ logger . info ( 'Termination signal received. Shutting down.' ) ;
70
67
71
- runner . stop ( ) . then ( exit , exitWithError ) ;
72
- }
68
+ runner . stop ( ) . then ( exit , exitWithError ) ;
69
+ }
73
70
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 ) ;
77
75
}
78
76
79
77
function cloud ( ) {
80
78
logger . prefixed = true ;
81
79
82
80
buildOptions ( )
83
- . then ( ( opts ) => {
81
+ . then ( opts => {
84
82
opts . driverHost = this . driverHost ;
85
83
opts . driverPort = this . driverPort ;
86
84
opts . driverRequestId = this . driverRequestId ;
@@ -98,9 +96,8 @@ function cloud() {
98
96
}
99
97
100
98
function deploy ( ) {
101
- buildOptions ( true )
102
- . then ( ( opts ) => {
103
- opts . keepZip = this . keepZip ;
99
+ buildOptions ( true ) . then ( opts => {
100
+ opts . keepZip = this . keepZip || opts . keepZip ;
104
101
105
102
return CodeRunner . deploy ( opts ) ;
106
103
} )
@@ -133,6 +130,8 @@ function buildOptions(appIsRequired) {
133
130
opts . backendless . msgBroker . port = program . msgBrokerPort || opts . backendless . msgBroker . port ;
134
131
opts . backendless . repoPath = program . repoPath || opts . backendless . repoPath || DEFAULT_REPO_PATH ;
135
132
133
+ opts . verbose = logger . verbose = program . verbose || opts . verbose ;
134
+
136
135
if ( appIsRequired ) {
137
136
opts . app = opts . app || { } ;
138
137
0 commit comments