File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -306,20 +306,28 @@ function cli(api) {
306
306
function readConfigData ( config ) {
307
307
var data = readConfigFile ( config ) ,
308
308
json ,
309
+ optionName ,
310
+ optionValue ,
311
+ args ,
309
312
options = { } ;
310
313
if ( data ) {
311
314
if ( data . charAt ( 0 ) === "{" ) {
312
315
try {
313
316
json = JSON . parse ( data ) ;
314
317
data = "" ;
315
- for ( var optionName in json ) {
318
+ for ( optionName in json ) {
316
319
if ( json . hasOwnProperty ( optionName ) ) {
317
- data += "--" + optionName + "=" + json [ optionName ] . join ( ) ;
320
+ optionValue = json [ optionName ] ;
321
+ if ( Array . isArray ( optionValue ) ) {
322
+ optionValue = optionValue . join ( "," ) ;
323
+ }
324
+ data += "--" + optionName + "=" + optionValue ;
318
325
}
319
326
}
320
327
} catch ( e ) { }
321
328
}
322
- options = processArguments ( data . split ( / [ \s \n \r ] + / m) ) ;
329
+ args = data . replace ( / \s + / g, "" ) . split ( / (? = - - ) / ) ;
330
+ options = processArguments ( args ) ;
323
331
}
324
332
325
333
return options ;
You can’t perform that action at this time.
0 commit comments