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

Function readConfig

cli/src/sysconfig.ts:34–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32}
33
34export async function readConfig(): Promise<SystemConfig> {
35 debug('Reading from %O', SYSCONFIG_PATH);
36
37 try {
38 return await readJSON(SYSCONFIG_PATH);
39 } catch (e: any) {
40 if (e.code !== 'ENOENT') {
41 throw e;
42 }
43
44 const sysconfig: SystemConfig = {
45 machine: uuidv4(),
46 };
47
48 await writeConfig(sysconfig);
49
50 return sysconfig;
51 }
52}
53
54export async function writeConfig(sysconfig: SystemConfig): Promise<void> {
55 debug('Writing to %O', SYSCONFIG_PATH);

Callers 3

telemetryActionFunction · 0.90
runMergeConfigFunction · 0.90
telemetryCommandFunction · 0.90

Calls 3

uuidv4Function · 0.90
readJSONFunction · 0.85
writeConfigFunction · 0.70

Tested by

no test coverage detected