foliko 1.1.41 → 1.1.42
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.
|
@@ -7,11 +7,11 @@ const fs = require('fs');
|
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const { spawn } = require('child_process');
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
const DAEMON_SCRIPT = path.join(
|
|
13
|
-
const PID_FILE = path.join(
|
|
14
|
-
const LOG_FILE = path.join(
|
|
10
|
+
// 使用当前工作目录
|
|
11
|
+
const CWD = process.cwd();
|
|
12
|
+
const DAEMON_SCRIPT = path.join(__dirname, '../../../examples/daemon.js');
|
|
13
|
+
const PID_FILE = path.join(CWD, '.foliko.pid');
|
|
14
|
+
const LOG_FILE = path.join(CWD, '.foliko.log');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* 获取 PID 文件中的进程 ID
|
|
@@ -51,7 +51,7 @@ async function startDaemon() {
|
|
|
51
51
|
const child = spawn(process.execPath, [DAEMON_SCRIPT], {
|
|
52
52
|
detached: true,
|
|
53
53
|
stdio: 'ignore',
|
|
54
|
-
cwd:
|
|
54
|
+
cwd: CWD,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// 重定向输出到日志文件
|