feat: add update scripts for all tools + Update section in README
- gemini/ugemini_update.sh + .ps1 - codex/ucodex_update.sh + .ps1 - qwen/uqwen_update.sh + .ps1 - README.md: added Update section with one-line and cloned-repo commands - README.md: removed outdated Codex update instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
69
qwen/uqwen_update.ps1
Normal file
69
qwen/uqwen_update.ps1
Normal file
@@ -0,0 +1,69 @@
|
||||
# Qwen Code — Windows Updater
|
||||
# Usage: powershell -ExecutionPolicy Bypass -File qwen\uqwen_update.ps1
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host " | Qwen Code -- Windows Updater |" -ForegroundColor Cyan
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
function Refresh-Path {
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" +
|
||||
[System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
}
|
||||
|
||||
# ---- Check current version ----
|
||||
|
||||
$qwenBin = $null
|
||||
foreach ($candidate in @("qwen", "qwen-code")) {
|
||||
if (Get-Command $candidate -ErrorAction SilentlyContinue) { $qwenBin = $candidate; break }
|
||||
}
|
||||
$oldVer = if ($qwenBin) { & $qwenBin --version 2>$null } else { "not installed" }
|
||||
Write-Host " Current: $oldVer" -ForegroundColor Cyan
|
||||
|
||||
# ---- Configure registry ----
|
||||
|
||||
Write-Host " Configuring npm registry..." -ForegroundColor Cyan
|
||||
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/" 2>$null
|
||||
|
||||
# ---- Update package ----
|
||||
|
||||
Write-Host " Installing latest @qwen-code/qwen-code..." -ForegroundColor Cyan
|
||||
npm install -g @qwen-code/qwen-code 2>&1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host " npm install failed." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Refresh-Path
|
||||
|
||||
foreach ($candidate in @("qwen", "qwen-code")) {
|
||||
if (Get-Command $candidate -ErrorAction SilentlyContinue) { $qwenBin = $candidate; break }
|
||||
}
|
||||
$newVer = if ($qwenBin) { & $qwenBin --version 2>$null } else { "unknown" }
|
||||
Write-Host " Updated: $oldVer -> $newVer" -ForegroundColor Green
|
||||
|
||||
# ---- Download and apply patches ----
|
||||
|
||||
$pyCmd = if (Get-Command python3 -ErrorAction SilentlyContinue) { "python3" } else { "python" }
|
||||
$tempDir = Join-Path $env:TEMP "qwen-update-$(Get-Random)"
|
||||
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
|
||||
|
||||
$repoRaw = "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen"
|
||||
Write-Host " Downloading patcher..." -ForegroundColor Cyan
|
||||
Invoke-WebRequest -Uri "$repoRaw/qwen_patcher.py" -OutFile "$tempDir\qwen_patcher.py" -UseBasicParsing
|
||||
Invoke-WebRequest -Uri "$repoRaw/qwen_config.json" -OutFile "$tempDir\qwen_config.json" -UseBasicParsing
|
||||
|
||||
Write-Host " Applying patches..." -ForegroundColor Cyan
|
||||
& $pyCmd "$tempDir\qwen_patcher.py" --settings-only --config "$tempDir\qwen_config.json"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host " Trying full patch..." -ForegroundColor Yellow
|
||||
& $pyCmd "$tempDir\qwen_patcher.py" --apply --config "$tempDir\qwen_config.json"
|
||||
}
|
||||
|
||||
Remove-Item -Recurse -Force $tempDir -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Update complete!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Reference in New Issue
Block a user