voicecc 1.1.26 → 1.1.27

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.
package/bin/voicecc.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * - Supports subcommands: stop, logs, autostart
11
11
  */
12
12
 
13
- import { spawn, execSync } from "node:child_process";
13
+ import { spawn, spawnSync, execSync } from "node:child_process";
14
14
  import { copyFileSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync, openSync, closeSync } from "node:fs";
15
15
  import { writeFile } from "node:fs/promises";
16
16
  import { createInterface } from "node:readline";
@@ -343,7 +343,7 @@ function stopDaemon() {
343
343
  }
344
344
 
345
345
  /**
346
- * Tail the log file.
346
+ * Tail the log file in the foreground (blocks until Ctrl+C).
347
347
  */
348
348
  function showLogs() {
349
349
  if (!existsSync(LOG_FILE)) {
@@ -351,9 +351,8 @@ function showLogs() {
351
351
  process.exit(1);
352
352
  }
353
353
 
354
- const child = spawn("tail", ["-n", "100", "-f", LOG_FILE], { stdio: "inherit" });
355
- process.on("SIGINT", () => child.kill("SIGINT"));
356
- child.on("exit", (code) => process.exit(code ?? 0));
354
+ const { status } = spawnSync("tail", ["-n", "100", "-f", LOG_FILE], { stdio: "inherit" });
355
+ process.exit(status ?? 0);
357
356
  }
358
357
 
359
358
  /**