helper.js 725 B

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