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) {
306306 function readConfigData ( config ) {
307307 var data = readConfigFile ( config ) ,
308308 json ,
309+ optionName ,
310+ optionValue ,
311+ args ,
309312 options = { } ;
310313 if ( data ) {
311314 if ( data . charAt ( 0 ) === "{" ) {
312315 try {
313316 json = JSON . parse ( data ) ;
314317 data = "" ;
315- for ( var optionName in json ) {
318+ for ( optionName in json ) {
316319 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 ;
318325 }
319326 }
320327 } catch ( e ) { }
321328 }
322- options = processArguments ( data . split ( / [ \s \n \r ] + / m) ) ;
329+ args = data . replace ( / \s + / g, "" ) . split ( / (? = - - ) / ) ;
330+ options = processArguments ( args ) ;
323331 }
324332
325333 return options ;
You can’t perform that action at this time.
0 commit comments