collabdocchat 1.0.6 → 1.0.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/.gitignore +3 -0
- package/package.json +1 -1
- package/scripts/stop-app.js +4 -5
package/.gitignore
CHANGED
package/package.json
CHANGED
package/scripts/stop-app.js
CHANGED
|
@@ -2,7 +2,7 @@ import { exec } from 'child_process';
|
|
|
2
2
|
import { platform } from 'os';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
import { dirname, join } from 'path';
|
|
5
|
-
import { existsSync, unlinkSync } from 'fs';
|
|
5
|
+
import { existsSync, unlinkSync, readFileSync } from 'fs';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = dirname(__filename);
|
|
@@ -14,11 +14,10 @@ const isWindows = platform() === 'win32';
|
|
|
14
14
|
console.log('🛑 正在停止 CollabDocChat 服务...\n');
|
|
15
15
|
|
|
16
16
|
// 读取 PID 文件
|
|
17
|
-
|
|
17
|
+
function readPidFile() {
|
|
18
18
|
if (existsSync(pidFile)) {
|
|
19
19
|
try {
|
|
20
|
-
const
|
|
21
|
-
const content = await fs.readFile(pidFile, 'utf-8');
|
|
20
|
+
const content = readFileSync(pidFile, 'utf-8');
|
|
22
21
|
return content.trim().split('\n').filter(Boolean);
|
|
23
22
|
} catch (error) {
|
|
24
23
|
return [];
|
|
@@ -104,7 +103,7 @@ async function main() {
|
|
|
104
103
|
let stopped = false;
|
|
105
104
|
|
|
106
105
|
// 方法1: 通过 PID 文件停止
|
|
107
|
-
const pids =
|
|
106
|
+
const pids = readPidFile();
|
|
108
107
|
if (pids.length > 0) {
|
|
109
108
|
console.log(`📋 找到 ${pids.length} 个进程记录`);
|
|
110
109
|
for (const pid of pids) {
|