galaxy-opc 0.5.13 → 0.5.15
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 +21 -0
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -156,6 +156,27 @@ function cleanupAgentModelOverrides() {
|
|
|
156
156
|
|
|
157
157
|
async function installOpenclawWithFallback() {
|
|
158
158
|
const env = buildOpenclawInstallEnv();
|
|
159
|
+
const isWindows = process.platform === "win32";
|
|
160
|
+
|
|
161
|
+
// 优先使用官方安装脚本(预编译二进制,绕开 npm git 依赖超时)
|
|
162
|
+
try {
|
|
163
|
+
console.log(dim(" 尝试 官方安装脚本(预编译二进制)安装 OpenClaw...\n"));
|
|
164
|
+
if (isWindows) {
|
|
165
|
+
await runCommand("powershell", [
|
|
166
|
+
"-NoProfile", "-NonInteractive", "-Command",
|
|
167
|
+
"iwr -useb https://openclaw.ai/install.ps1 | iex",
|
|
168
|
+
], { env });
|
|
169
|
+
} else {
|
|
170
|
+
await runCommand("bash", [
|
|
171
|
+
"-c", "curl -fsSL https://openclaw.ai/install.sh | bash",
|
|
172
|
+
], { env });
|
|
173
|
+
}
|
|
174
|
+
return;
|
|
175
|
+
} catch (e) {
|
|
176
|
+
console.log(yellow(` ! 官方安装脚本失败: ${e.message}\n`));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// 降级到 npm install
|
|
159
180
|
const attempts = [
|
|
160
181
|
{
|
|
161
182
|
label: "官方源(原生)",
|