(config: Config, extConfig: ExternalConfig, type: 'json' | 'ts')
| 126 | } |
| 127 | |
| 128 | async function runMergeConfig(config: Config, extConfig: ExternalConfig, type: 'json' | 'ts') { |
| 129 | const configDirectory = dirname(config.app.extConfigFilePath); |
| 130 | const newConfigPath = resolve(configDirectory, type === 'ts' ? CONFIG_FILE_NAME_TS : CONFIG_FILE_NAME_JSON); |
| 131 | |
| 132 | await runTask(`Creating ${c.strong(basename(newConfigPath))} in ${c.input(config.app.rootDir)}`, async () => { |
| 133 | await mergeConfig(config, extConfig, newConfigPath); |
| 134 | }); |
| 135 | |
| 136 | printNextSteps(basename(newConfigPath)); |
| 137 | if (isInteractive()) { |
| 138 | let sysconfig = await readConfig(); |
| 139 | if (typeof sysconfig.signup === 'undefined') { |
| 140 | const signup = await promptToSignup(); |
| 141 | sysconfig = { ...sysconfig, signup }; |
| 142 | await sysWriteConfig(sysconfig); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | async function mergeConfig(config: Config, extConfig: ExternalConfig, newConfigPath: string): Promise<void> { |
| 148 | const oldConfig = { ...config.app.extConfig }; |
no test coverage detected