@aiyiran/myclaw 1.0.38 → 1.0.39

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 (3) hide show
  1. package/index.js +0 -1
  2. package/package.json +2 -2
  3. package/prepare.js +12 -0
package/index.js CHANGED
@@ -296,7 +296,6 @@ function runBat() {
296
296
  const batContent = `@echo off
297
297
  chcp 65001 >nul 2>&1
298
298
  title OpenClaw
299
- color 0A
300
299
  echo.
301
300
  echo ============================================
302
301
  echo OpenClaw
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "postinstall": "node -e \"try{require('./patch').patch()}catch(e){console.log('[myclaw] patch skipped:',e.message)}\""
12
+ "postinstall": "node index.js prepare"
13
13
  },
14
14
  "keywords": [],
15
15
  "author": "",
package/prepare.js CHANGED
@@ -36,6 +36,9 @@ const C = isWindows
36
36
 
37
37
  const BAR = '========================================';
38
38
 
39
+ // 检测是否在 npm postinstall 中运行(非交互模式)
40
+ const isPostInstall = process.env.npm_lifecycle_event === 'postinstall';
41
+
39
42
  // ============================================================================
40
43
  // 工具:交互式问答
41
44
  // ============================================================================
@@ -220,6 +223,15 @@ async function installOpenClaw(env, openclawStatus) {
220
223
  }
221
224
 
222
225
  // Mac / Linux
226
+ if (isPostInstall) {
227
+ // postinstall 模式下不交互,跳过安装
228
+ console.log('');
229
+ console.log(' OpenClaw 未安装,请手动运行:');
230
+ console.log(' ' + C.y + 'myclaw install' + C.nc);
231
+ console.log('');
232
+ return false;
233
+ }
234
+
223
235
  console.log('');
224
236
  const answer = await ask(
225
237
  ' 是否现在安装 OpenClaw? (y/n): '