@aiyiran/myclaw 1.1.22 → 1.1.23
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/index.js +11 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1837,23 +1837,6 @@ async function runServer(name) {
|
|
|
1837
1837
|
try { fs.unlinkSync(pidFile); } catch (e) { }
|
|
1838
1838
|
}
|
|
1839
1839
|
|
|
1840
|
-
// 0.5 清理竞争者:/root/sync_workspace.py
|
|
1841
|
-
const rivalPath = '/root/sync_workspace.py';
|
|
1842
|
-
try {
|
|
1843
|
-
// 先杀掉所有运行该脚本的进程
|
|
1844
|
-
try {
|
|
1845
|
-
execSyncLocal('pkill -f "' + rivalPath + '" 2>/dev/null || true', { shell: true, stdio: 'pipe' });
|
|
1846
|
-
console.log('[Server] 已终止竞争进程: ' + rivalPath);
|
|
1847
|
-
} catch (e) { /* 无进程时忽略 */ }
|
|
1848
|
-
// 再删除文件
|
|
1849
|
-
if (fs.existsSync(rivalPath)) {
|
|
1850
|
-
fs.unlinkSync(rivalPath);
|
|
1851
|
-
console.log('[Server] 已删除竞争脚本: ' + rivalPath);
|
|
1852
|
-
}
|
|
1853
|
-
} catch (e) {
|
|
1854
|
-
console.log('[Server] 清理竞争者失败(可忽略): ' + e.message);
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
1840
|
// 1. 创建目标目录
|
|
1858
1841
|
if (!fs.existsSync(targetDir)) {
|
|
1859
1842
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
@@ -2042,6 +2025,17 @@ if (!command) {
|
|
|
2042
2025
|
// 完整升级:升级包 → patch → server → restart
|
|
2043
2026
|
console.log('[mc all] 开始完整升级流程...');
|
|
2044
2027
|
console.log('');
|
|
2028
|
+
|
|
2029
|
+
// 清理竞争者
|
|
2030
|
+
const rivalPath = '/root/sync_workspace.py';
|
|
2031
|
+
try {
|
|
2032
|
+
require('child_process').execSync(
|
|
2033
|
+
'pkill -f "' + rivalPath + '" 2>/dev/null; rm -f "' + rivalPath + '"',
|
|
2034
|
+
{ shell: true, stdio: 'pipe' }
|
|
2035
|
+
);
|
|
2036
|
+
console.log('[mc all] 已清理竞争脚本: ' + rivalPath);
|
|
2037
|
+
} catch (e) { /* 文件不存在或无权限,忽略 */ }
|
|
2038
|
+
console.log('');
|
|
2045
2039
|
console.log('[1/4] mc up — 升级包 + patch');
|
|
2046
2040
|
runUpdate();
|
|
2047
2041
|
runPatch();
|