fix: harden CLI parsing, MCP startup and release integrity

This commit is contained in:
gitea committed 2026-10-17 20:32:36 +08:00
1 parent f0902f5f20
commit 103ead0fe5
53 files changed
+3713 -1945

No files matched your search

+4 -4
View File
@@ -13,6 +13,7 @@ import {
detectArch,
detectPlatform,
downloadFile,
downloadVerifiedReleaseAsset,
extractTarGz,
extractZip,
fetchGitHubRelease,
@@ -447,14 +448,13 @@ export async function handleUpdateCommand(
mkdirSync(tmpDir, { recursive: true });
try {
const downloadedFile = join(tmpDir, asset.name);
await downloadFile(asset.downloadUrl, downloadedFile, release.tagName, asset.name, repo, options.sourcePreference);
const downloadedFile = await downloadVerifiedReleaseAsset(release, asset, tmpDir, repo, options.sourcePreference);
let newBinaryPath = downloadedFile;
if (asset.name.endsWith(".tar.gz") || asset.name.endsWith(".tgz")) {
newBinaryPath = extractTarGz(downloadedFile, tmpDir, platform);
newBinaryPath = extractTarGz(downloadedFile, tmpDir, platform, arch);
} else if (asset.name.endsWith(".zip")) {
newBinaryPath = extractZip(downloadedFile, tmpDir, platform);
newBinaryPath = extractZip(downloadedFile, tmpDir, platform, arch);
}
chmodSync(newBinaryPath, 0o755);