UNPKG

654 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.sendMessage = void 0;
4const utils_fs_1 = require("@ionic/utils-fs");
5const utils_subprocess_1 = require("@ionic/utils-subprocess");
6const path = require("path");
7async function sendMessage({ config, ctx }, msg) {
8 const dir = path.dirname(config.p);
9 await utils_fs_1.mkdirp(dir);
10 const fd = await utils_fs_1.open(path.resolve(dir, 'helper.log'), 'a');
11 const p = utils_subprocess_1.fork(ctx.binPath, ['_', '--no-interactive'], { stdio: ['ignore', fd, fd, 'ipc'] });
12 p.send(msg);
13 p.disconnect();
14 p.unref();
15}
16exports.sendMessage = sendMessage;