MCPcopy Index your code
hub / github.com/ionic-team/capacitor / writeConfig

Function writeConfig

cli/src/config.ts:83–94  ·  view source on GitHub ↗
(extConfig: ExternalConfig, extConfigFilePath: string)

Source from the content-addressed store, hash-verified

81}
82
83export async function writeConfig(extConfig: ExternalConfig, extConfigFilePath: string): Promise<void> {
84 switch (extname(extConfigFilePath)) {
85 case '.json': {
86 await writeJSON(extConfigFilePath, extConfig, { spaces: 2 });
87 break;
88 }
89 case '.ts': {
90 await writeFile(extConfigFilePath, formatConfigTS(extConfig));
91 break;
92 }
93 }
94}
95
96type ExtConfigPairs = Pick<AppConfig, 'extConfigType' | 'extConfigName' | 'extConfigFilePath' | 'extConfig'>;
97

Callers

nothing calls this directly

Calls 2

writeJSONFunction · 0.85
formatConfigTSFunction · 0.85

Tested by

no test coverage detected