@aiyiran/myclaw 1.0.46 → 1.0.47
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 +19 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -290,7 +290,25 @@ function runBat() {
|
|
|
290
290
|
|
|
291
291
|
const batPath = path.join(myClawDir, 'openclaw-launcher.bat');
|
|
292
292
|
const desktopPath = path.join(os.homedir(), 'Desktop');
|
|
293
|
-
|
|
293
|
+
|
|
294
|
+
// 生成时间戳
|
|
295
|
+
const now = new Date();
|
|
296
|
+
const mm = String(now.getMonth() + 1).padStart(2, '0');
|
|
297
|
+
const dd = String(now.getDate()).padStart(2, '0');
|
|
298
|
+
const hh = String(now.getHours()).padStart(2, '0');
|
|
299
|
+
const mi = String(now.getMinutes()).padStart(2, '0');
|
|
300
|
+
const ss = String(now.getSeconds()).padStart(2, '0');
|
|
301
|
+
const ver = require('./package.json').version;
|
|
302
|
+
|
|
303
|
+
// 删除旧的 OpenClaw*.lnk
|
|
304
|
+
try {
|
|
305
|
+
const oldLinks = fs.readdirSync(desktopPath).filter(f => f.endsWith('.lnk') && (f.includes('OpenClaw') || f.match(/^\d+\.\d+\.\d+_OpenClaw/)));
|
|
306
|
+
for (const old of oldLinks) {
|
|
307
|
+
try { fs.unlinkSync(path.join(desktopPath, old)); } catch {}
|
|
308
|
+
}
|
|
309
|
+
} catch {}
|
|
310
|
+
|
|
311
|
+
const lnkPath = path.join(desktopPath, ver + '_OpenClaw_' + mm + '-' + dd + '_' + hh + '-' + mi + '-' + ss + '.lnk');
|
|
294
312
|
|
|
295
313
|
// === 智能启动器 bat 内容(用 goto 标签避免中文在 if 块内的编码问题) ===
|
|
296
314
|
const batContent = `@echo off
|