myagent-ai 1.24.1 → 1.24.2
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/package.json +1 -1
- package/start.js +7 -1
package/package.json
CHANGED
package/start.js
CHANGED
|
@@ -641,7 +641,13 @@ function cmdUninstall() {
|
|
|
641
641
|
if (IS_WIN) {
|
|
642
642
|
execSync('taskkill /F /IM python.exe /FI "WINDOWTITLE eq myagent*" 2>nul', { encoding: "utf8", timeout: 5000 });
|
|
643
643
|
} else {
|
|
644
|
-
|
|
644
|
+
// 排除当前进程 PID,避免 pkill 杀掉 uninstall 脚本自身
|
|
645
|
+
const selfPid = process.pid;
|
|
646
|
+
execSync(
|
|
647
|
+
`pgrep -f 'myagent|main.py' | grep -v '^${selfPid}$' | xargs -r kill 2>/dev/null; sleep 1; ` +
|
|
648
|
+
`pgrep -f 'myagent|main.py' | grep -v '^${selfPid}$' | xargs -r kill -9 2>/dev/null`,
|
|
649
|
+
{ encoding: "utf8", timeout: 10000 }
|
|
650
|
+
);
|
|
645
651
|
}
|
|
646
652
|
} catch (_) {}
|
|
647
653
|
|