schrun 0.3.5 → 0.3.7
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/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { i as PID_FILE, n as CLI_COMMAND_NAME, r as CONFIG_DIR, t as readJSON }
|
|
|
3
3
|
import { cli, define } from "gunshi";
|
|
4
4
|
import { readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
5
5
|
import { consola } from "consola";
|
|
6
|
-
import { spawn } from "node:child_process";
|
|
6
|
+
import { fork, spawn } from "node:child_process";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import Table from "cli-table3";
|
|
9
9
|
// src/version.ts
|
|
@@ -45,7 +45,7 @@ const runsurface = async (FileName) => {
|
|
|
45
45
|
// src/run/startScheduler.ts
|
|
46
46
|
const startSchedule = async () => {
|
|
47
47
|
const daemonPath = fileURLToPath(new URL("./daemon.mjs", import.meta.url));
|
|
48
|
-
const child =
|
|
48
|
+
const child = fork(process.execPath, [daemonPath], {
|
|
49
49
|
detached: true,
|
|
50
50
|
stdio: "ignore"
|
|
51
51
|
});
|
|
@@ -55,6 +55,7 @@ const startSchedule = async () => {
|
|
|
55
55
|
});
|
|
56
56
|
await writeFile(PID_FILE, String(child.pid), "utf-8");
|
|
57
57
|
child.unref();
|
|
58
|
+
consola.success("Success start scheduler");
|
|
58
59
|
};
|
|
59
60
|
// src/run/stopScheduler.ts
|
|
60
61
|
const stopSchedule = async () => {
|