File tree Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,8 @@ const optionList:
252252
253253export const optionKeys = optionList . map ( ( { name } ) => camelize ( name ) ) ;
254254
255+ export const optionKeysWithDefalts = optionList . filter ( o => o . hasOwnProperty ( 'default' ) ) . map ( ( { name } ) => camelize ( name ) ) ;
256+
255257export const PrimitiveConverter = {
256258 Number : 1 ,
257259 Boolean : true ,
@@ -370,23 +372,36 @@ export const cli: () => {
370372 * 3. CLI flags
371373 */
372374
375+ const nonCliConfigs = {
376+ /**
377+ * Environmental Variables
378+ */
379+ ...envArgs ( ) ,
380+ /**
381+ * The configuration file OR the --config base64 encoded config object
382+ */
383+ ...( configFile ( _cli . flags . config as string ) || { } ) ,
384+ }
385+
386+ optionList . filter ( option => option . default )
387+
373388 const cliConfig : any = {
374389 sessionId : "session" ,
375390 /**
376391 * Prioirity goes from bottom up
377392 */
393+ ...nonCliConfigs ,
378394 /**
379- * Environmental Variables
380- */
381- ...envArgs ( ) ,
382- /**
383- * The configuration file OR the --config base64 encoded config object
395+ * CLI flags
384396 */
385- ...( configFile ( _cli . flags . config as string ) || { } ) ,
397+ ..._cli . flags ,
386398 /**
387- * CLI flags
399+ * Grab the configs for the cli defaults
388400 */
389- ..._cli . flags
401+ ...optionKeysWithDefalts . reduce ( ( p , c ) => nonCliConfigs . hasOwnProperty ( c ) ? {
402+ ...p ,
403+ [ c ] :nonCliConfigs [ c ]
404+ } : p , { } )
390405 } ;
391406
392407 const PORT = Number ( cliConfig . port || process . env . PORT || 8080 ) ;
You can’t perform that action at this time.
0 commit comments