MCPcopy
hub / github.com/ionic-team/capacitor / runMergeConfig

Function runMergeConfig

cli/src/tasks/init.ts:128–145  ·  view source on GitHub ↗
(config: Config, extConfig: ExternalConfig, type: 'json' | 'ts')

Source from the content-addressed store, hash-verified

126}
127
128async 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
147async function mergeConfig(config: Config, extConfig: ExternalConfig, newConfigPath: string): Promise<void> {
148 const oldConfig = { ...config.app.extConfig };

Callers 1

initCommandFunction · 0.85

Calls 6

runTaskFunction · 0.90
isInteractiveFunction · 0.90
readConfigFunction · 0.90
mergeConfigFunction · 0.85
promptToSignupFunction · 0.85
printNextStepsFunction · 0.70

Tested by

no test coverage detected