private findAppConfigFile()

in lib/template/app-context.ts [83:104]


    private findAppConfigFile(appConfigKey: string): string {
        let fromType = 'InLine-Argument';
        let configFilePath = this.cdkApp.node.tryGetContext(appConfigKey);

        if (configFilePath == undefined) {
            configFilePath = env.get(appConfigKey).asString();

            if (configFilePath != undefined && configFilePath.length > 0) {
                fromType = 'Environment-Variable';
            } else {
                configFilePath = undefined;
            }
        }

        if (configFilePath == undefined) {
            throw new Error('Fail to find App-Config json file')
        } else {
            console.info(`==> CDK App-Config File is ${configFilePath}, which is from ${fromType}.`);
        }

        return configFilePath;
    }