@aiyiran/myclaw 1.0.38 → 1.0.40
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 +2 -3
- package/package.json +2 -2
- 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
|
|
@@ -341,8 +340,8 @@ if not errorlevel 1 goto :gateway_running
|
|
|
341
340
|
REM Gateway not running -> update myclaw first, then start
|
|
342
341
|
echo Starting...
|
|
343
342
|
echo.
|
|
344
|
-
echo [update] npm
|
|
345
|
-
call npm
|
|
343
|
+
echo [update] npm install -g @aiyiran/myclaw@latest
|
|
344
|
+
call npm install -g @aiyiran/myclaw@latest >nul 2>&1
|
|
346
345
|
echo [update] OK
|
|
347
346
|
echo.
|
|
348
347
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiyiran/myclaw",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
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
|
|
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): '
|