galaxy-opc 0.5.19 → 0.5.20
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/bin/cli.mjs +4 -23
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -158,35 +158,16 @@ function cleanupAgentModelOverrides() {
|
|
|
158
158
|
|
|
159
159
|
async function installOpenclawWithFallback() {
|
|
160
160
|
const env = buildOpenclawInstallEnv();
|
|
161
|
-
const isWindows = process.platform === "win32";
|
|
162
161
|
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
console.log(dim(" 尝试 官方安装脚本(预编译二进制)安装 OpenClaw...\n"));
|
|
166
|
-
if (isWindows) {
|
|
167
|
-
// shell: false 避免 cmd.exe 拦截管道符(否则 iex 会被 cmd 执行而非 PowerShell)
|
|
168
|
-
await runCommand("powershell", [
|
|
169
|
-
"-NoProfile", "-NonInteractive", "-Command",
|
|
170
|
-
"iwr -useb https://openclaw.ai/install.ps1 | iex",
|
|
171
|
-
], { env, shell: false });
|
|
172
|
-
} else {
|
|
173
|
-
await runCommand("bash", [
|
|
174
|
-
"-c", "curl -fsSL https://openclaw.ai/install.sh | bash",
|
|
175
|
-
], { env });
|
|
176
|
-
}
|
|
177
|
-
return;
|
|
178
|
-
} catch (e) {
|
|
179
|
-
console.log(yellow(` ! 官方安装脚本失败: ${e.message}\n`));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// 降级到 npm install
|
|
162
|
+
// 官方安装脚本(install.sh / install.ps1)会在安装后自动启动 openclaw onboarding 向导,
|
|
163
|
+
// 与本向导流程冲突,因此统一使用 npm install,China 网络自动降级到 npmmirror。
|
|
183
164
|
const attempts = [
|
|
184
165
|
{
|
|
185
|
-
label: "
|
|
166
|
+
label: "官方源",
|
|
186
167
|
args: ["install", "-g", "openclaw@latest"],
|
|
187
168
|
},
|
|
188
169
|
{
|
|
189
|
-
label: "国内镜像(
|
|
170
|
+
label: "国内镜像(npmmirror)",
|
|
190
171
|
args: ["install", "-g", "openclaw@latest", "--registry", "https://registry.npmmirror.com"],
|
|
191
172
|
},
|
|
192
173
|
];
|