@aiyiran/myclaw 1.0.45 → 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.
Files changed (2) hide show
  1. package/index.js +21 -7
  2. 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
- const lnkPath = path.join(desktopPath, 'OpenClaw.lnk');
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
@@ -368,12 +386,8 @@ exit /b
368
386
  :gateway_running
369
387
  echo [OK] Running
370
388
 
371
- REM ---- Step 4: Patch + Open browser ----
372
- echo [4/5] Patch...
373
- wsl -d OpenClaw -- myclaw patch
374
- echo [OK]
375
-
376
- echo [5/5] Browser...
389
+ REM ---- Open browser ----
390
+ echo [4/4] Browser...
377
391
  call myclaw open
378
392
  echo [OK]
379
393
  echo.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {