UNPKG

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