File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,11 @@ module.exports = function (args) {
76
76
. then ( function ( exit_code ) {
77
77
console . log ( "stopping tunnel" ) ;
78
78
tunnelInstance . stop ( ) ;
79
- process . exit ( exit_code ) ;
79
+ if (
80
+ lt_config [ "run_settings" ] [ "exit-on-failure" ]
81
+ ) {
82
+ process . exit ( exit_code ) ;
83
+ }
80
84
} )
81
85
. catch ( function ( error ) {
82
86
console . log ( "stopping tunnel failed" ) ;
@@ -93,10 +97,14 @@ module.exports = function (args) {
93
97
batch_runner
94
98
. run_batches ( lt_config , batches , env )
95
99
. then ( function ( exit_code ) {
96
- process . exit ( exit_code ) ;
100
+ if ( lt_config [ "run_settings" ] [ "exit-on-failure" ] ) {
101
+ process . exit ( exit_code ) ;
102
+ }
97
103
} )
98
104
. catch ( function ( error ) {
99
- process . exit ( 1 ) ;
105
+ if ( lt_config [ "run_settings" ] [ "exit-on-failure" ] ) {
106
+ process . exit ( 1 ) ;
107
+ }
100
108
} ) ;
101
109
}
102
110
} )
Original file line number Diff line number Diff line change @@ -235,7 +235,13 @@ function sync_args_from_cmd(args) {
235
235
}
236
236
if ( "sync" in args ) {
237
237
lt_config [ "run_settings" ] [ "sync" ] = true ? args [ "sync" ] == "true" : false ;
238
+ if ( "exit-on-failure" in args ) {
239
+ lt_config [ "run_settings" ] [ "exit-on-failure" ] = true ;
240
+ } else {
241
+ lt_config [ "run_settings" ] [ "exit-on-failure" ] = false ;
242
+ }
238
243
}
244
+
239
245
if ( "autostart" in args ) {
240
246
lt_config [ "tunnel_settings" ] [ "autostart" ] = true
241
247
? args [ "autostart" ] == "true"
Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ const argv = require("yargs")
98
98
describe : "Capture Network logs" ,
99
99
type : "string" ,
100
100
} )
101
+ . option ( "eof" , {
102
+ alias : "exit-on-failure" ,
103
+ describe : "Exit With Code 1 on failure" ,
104
+ type : "string" ,
105
+ } )
101
106
) ;
102
107
} ,
103
108
function ( argv ) {
You can’t perform that action at this time.
0 commit comments