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

Function send

cli/src/ipc.ts:22–35  ·  view source on GitHub ↗
(msg: IPCMessage)

Source from the content-addressed store, hash-verified

20 * Send an IPC message to a forked process.
21 */
22export async function send(msg: IPCMessage): Promise<void> {
23 const dir = ENV_PATHS.log;
24 await mkdirp(dir);
25 const logPath = resolve(dir, 'ipc.log');
26
27 debug('Sending %O IPC message to forked process (logs: %O)', msg.type, logPath);
28
29 const fd = await open(logPath, 'a');
30 const p = fork(process.argv[1], ['📡'], { stdio: ['ignore', fd, fd, 'ipc'] });
31
32 p.send(msg);
33 p.disconnect();
34 p.unref();
35}
36
37/**
38 * Receive and handle an IPC message.

Callers 1

sendMetricFunction · 0.90

Calls 2

openFunction · 0.85
disconnectMethod · 0.80

Tested by

no test coverage detected