Improve extensions consent flow, command formatting, github-release behavior (#9121)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
christine betts
2025-09-22 19:50:12 -04:00
committed by GitHub
parent 4cdf9207f3
commit 570b0086b6
4 changed files with 49 additions and 32 deletions

View File

@@ -220,11 +220,14 @@ export async function checkForExtensionUpdate(
return;
}
}
export interface GitHubDownloadResult {
tagName: string;
type: 'git' | 'github-release';
}
export async function downloadFromGitHubRelease(
installMetadata: ExtensionInstallMetadata,
destination: string,
): Promise<string> {
): Promise<GitHubDownloadResult> {
const { source, ref } = installMetadata;
const { owner, repo } = parseGitHubRepoForReleases(source);
@@ -289,7 +292,10 @@ export async function downloadFromGitHubRelease(
}
await fs.promises.unlink(downloadedAssetPath);
return releaseData.tag_name;
return {
tagName: releaseData.tag_name,
type: 'github-release',
};
} catch (error) {
throw new Error(
`Failed to download release from ${installMetadata.source}: ${getErrorMessage(error)}`,