chore: align install flow with latest OpenClaw and remove marketing copy
This commit is contained in:
@@ -144,43 +144,31 @@ if (Get-Command git -ErrorAction SilentlyContinue) {
|
||||
}
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# 步骤 3: 安装 OpenClaw
|
||||
# 步骤 3: 安装 / 更新 OpenClaw
|
||||
# ─────────────────────────────────────────────
|
||||
Write-Info "正在检查 OpenClaw..."
|
||||
Write-Info "正在安装 / 更新 OpenClaw..."
|
||||
|
||||
$needsInstall = $true
|
||||
npm install -g openclaw@latest 2>&1 | Write-Host
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Err "OpenClaw 安装失败。请手动运行:npm install -g openclaw@latest"
|
||||
}
|
||||
|
||||
# 刷新 PATH
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
|
||||
# 把 npm global bin 加到 PATH
|
||||
try {
|
||||
$null = Get-Command openclaw -ErrorAction Stop
|
||||
Write-Ok "已找到 OpenClaw。"
|
||||
$needsInstall = $false
|
||||
} catch {
|
||||
Write-Info "正在安装 OpenClaw..."
|
||||
}
|
||||
|
||||
if ($needsInstall) {
|
||||
npm install -g openclaw@latest 2>&1 | Write-Host
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Err "OpenClaw 安装失败。请手动运行:npm install -g openclaw@latest"
|
||||
}
|
||||
|
||||
# 刷新 PATH
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
|
||||
# 把 npm global bin 加到 PATH
|
||||
try {
|
||||
$npmPrefix = (npm config get prefix 2>$null).Trim()
|
||||
if ($npmPrefix) {
|
||||
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
||||
if (-not ($userPath -split ";" | Where-Object { $_ -ieq $npmPrefix })) {
|
||||
[Environment]::SetEnvironmentVariable("Path", "$userPath;$npmPrefix", "User")
|
||||
$env:Path += ";$npmPrefix"
|
||||
}
|
||||
$npmPrefix = (npm config get prefix 2>$null).Trim()
|
||||
if ($npmPrefix) {
|
||||
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
||||
if (-not ($userPath -split ";" | Where-Object { $_ -ieq $npmPrefix })) {
|
||||
[Environment]::SetEnvironmentVariable("Path", "$userPath;$npmPrefix", "User")
|
||||
$env:Path += ";$npmPrefix"
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
} catch {}
|
||||
|
||||
Write-Ok "OpenClaw 安装完成。"
|
||||
}
|
||||
Write-Ok "OpenClaw 安装 / 更新完成。"
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# 步骤 3: 启动交互式配置
|
||||
@@ -190,12 +178,8 @@ Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host " OpenClaw 安装完成!开始配置..." -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host " 提示:当配置向导要求选择服务商时," -ForegroundColor White
|
||||
Write-Host " 选择 MiniMax 可获得 7天免费试用 - 无需信用卡。" -ForegroundColor White
|
||||
Write-Host " 注册地址:https://platform.minimax.io" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
openclaw onboard --accept-risk --flow quickstart --node-manager npm --skip-skills
|
||||
openclaw onboard --accept-risk --flow quickstart --install-daemon --node-manager npm --skip-skills
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user