@@ -66,7 +66,7 @@ class BaseCommand extends Command {
6666 }
6767
6868 async getAppExtConfigs ( flags , options = { } ) {
69- const all = ( await this . getFullConfig ( options ) ) . all
69+ const all = ( await this . getFullConfig ( options , flags ) ) . all
7070
7171 // default case: no flags, return all
7272 let ret = all
@@ -96,41 +96,41 @@ class BaseCommand extends Command {
9696 return ret
9797 }
9898
99- async getRuntimeManifestConfigFile ( implName ) {
99+ async getRuntimeManifestConfigFile ( implName , flags ) {
100100 let configKey
101101 if ( implName === APPLICATION_CONFIG_KEY ) {
102102 configKey = APPLICATION_CONFIG_KEY
103103 } else {
104104 configKey = `${ EXTENSIONS_CONFIG_KEY } .${ implName } `
105105 }
106- let configData = await this . getConfigFileForKey ( `${ configKey } .runtimeManifest` )
106+ let configData = await this . getConfigFileForKey ( `${ configKey } .runtimeManifest` , flags )
107107 if ( ! configData . file ) {
108108 // first action manifest is not defined
109- configData = await this . getConfigFileForKey ( `${ configKey } ` )
109+ configData = await this . getConfigFileForKey ( `${ configKey } ` , flags )
110110 configData . key = configData . key + '.runtimeManifest'
111111 }
112112 return configData
113113 }
114114
115- async getEventsConfigFile ( implName ) {
115+ async getEventsConfigFile ( implName , flags ) {
116116 let configKey
117117 if ( implName === APPLICATION_CONFIG_KEY ) {
118118 configKey = APPLICATION_CONFIG_KEY
119119 } else {
120120 configKey = `${ EXTENSIONS_CONFIG_KEY } .${ implName } `
121121 }
122- let configData = await this . getConfigFileForKey ( `${ configKey } .events` )
122+ let configData = await this . getConfigFileForKey ( `${ configKey } .events` , flags )
123123 if ( ! configData . file ) {
124124 // first events manifest is not defined
125- configData = await this . getConfigFileForKey ( `${ configKey } ` )
125+ configData = await this . getConfigFileForKey ( `${ configKey } ` , flags )
126126 configData . key = configData . key + '.events'
127127 }
128128 return configData
129129 }
130130
131- async getConfigFileForKey ( fullKey ) {
131+ async getConfigFileForKey ( fullKey , flags = { } ) {
132132 // NOTE: the index returns undefined if the key is loaded from a legacy configuration file
133- const fullConfig = await this . getFullConfig ( )
133+ const fullConfig = await this . getFullConfig ( { } , flags )
134134 // full key like 'extensions.dx/excshell/1.runtimeManifest'
135135 // returns { key: relKey, file: configFile}
136136 const configData = fullConfig . includeIndex [ fullKey ]
@@ -142,12 +142,12 @@ class BaseCommand extends Command {
142142 return configData || { }
143143 }
144144
145- async getFullConfig ( options = { } ) {
146- // validate appConfig defaults to false for now
147- const validateAppConfig = options . validateAppConfig === true
145+ async getFullConfig ( options = { } , flags = { } ) {
146+ // validate appConfig defaults to true unless flag is explicitly set to off
147+ const validateAppConfig = flags [ 'config-validation' ] !== false
148+ aioLogger . debug ( `validateAppConfig=${ validateAppConfig } ` )
148149
149150 if ( ! this . appConfig ) {
150- // this will explicitly set validateAppConfig=false if not set
151151 this . appConfig = await appConfig . load ( { ...options , validateAppConfig } )
152152 }
153153 return this . appConfig
@@ -191,7 +191,12 @@ class BaseCommand extends Command {
191191
192192BaseCommand . flags = {
193193 verbose : Flags . boolean ( { char : 'v' , description : 'Verbose output' } ) ,
194- version : Flags . boolean ( { description : 'Show version' } )
194+ version : Flags . boolean ( { description : 'Show version' } ) ,
195+ 'config-validation' : Flags . boolean ( {
196+ description : '[default: true] Validate the app configuration file(s) before continuing.' ,
197+ default : true ,
198+ allowNo : true
199+ } )
195200}
196201
197202BaseCommand . args = { }
0 commit comments