@threadbase-sh/streamer 1.101.7 → 1.101.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4517,6 +4517,7 @@ var launchd_entry_exports = {};
4517
4517
  __export(launchd_entry_exports, {
4518
4518
  decideShimAction: () => decideShimAction,
4519
4519
  findApnsKeyFile: () => findApnsKeyFile,
4520
+ forwardStopSignals: () => forwardStopSignals,
4520
4521
  loadApnsKeyIntoEnv: () => loadApnsKeyIntoEnv,
4521
4522
  loadInstallDirEnv: () => loadInstallDirEnv
4522
4523
  });
@@ -24405,15 +24406,21 @@ function main() {
24405
24406
  const env = { ...process.env };
24406
24407
  loadInstallDirEnv(env);
24407
24408
  loadApnsKeyIntoEnv(env);
24408
- const result = (0, import_node_child_process.spawnSync)(process.execPath, [target, ...args], {
24409
+ const child = (0, import_node_child_process.spawn)(process.execPath, [target, ...args], {
24409
24410
  stdio: "inherit",
24410
24411
  env
24411
24412
  });
24412
- if (result.error) {
24413
- log2.error(`failed to spawn ${target}: ${result.error.message}`);
24413
+ forwardStopSignals(child);
24414
+ child.on("error", (err) => {
24415
+ log2.error(`failed to spawn ${target}: ${err.message}`);
24414
24416
  process.exit(1);
24417
+ });
24418
+ child.on("exit", (code) => process.exit(code ?? 1));
24419
+ }
24420
+ function forwardStopSignals(child, from = process) {
24421
+ for (const signal of ["SIGTERM", "SIGINT"]) {
24422
+ from.on(signal, () => child.kill(signal));
24415
24423
  }
24416
- process.exit(result.status ?? 1);
24417
24424
  }
24418
24425
  if (typeof require !== "undefined" && require.main === module) {
24419
24426
  main();
@@ -24422,6 +24429,7 @@ if (typeof require !== "undefined" && require.main === module) {
24422
24429
  0 && (module.exports = {
24423
24430
  decideShimAction,
24424
24431
  findApnsKeyFile,
24432
+ forwardStopSignals,
24425
24433
  loadApnsKeyIntoEnv,
24426
24434
  loadInstallDirEnv
24427
24435
  });