File tree Expand file tree Collapse file tree 5 files changed +315
-170
lines changed Expand file tree Collapse file tree 5 files changed +315
-170
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { EventEmitter } from "events";
33import { CommandWithResult } from "./command.mjs" ;
44import Logger from "../logger.mjs" ;
55import Settings , { SettingsKey } from "../settings.mjs" ;
6- import { ContextKeys } from "../contextKeys.mjs" ;
76import State from "../state.mjs" ;
87
98export default class CompileProjectCommand extends CommandWithResult < boolean > {
Original file line number Diff line number Diff line change @@ -259,6 +259,19 @@ export async function downloadAndInstallArchive(
259259 return false ;
260260 }
261261
262+ // TODO: find and eliminate issue why this is necesarry
263+ if ( archiveExtension . length > 6 ) {
264+ archiveExtension = getArchiveExtension ( archiveFileName ) ;
265+ if ( ! archiveExtension ) {
266+ Logger . error (
267+ LoggerSource . downloader ,
268+ `Could not determine archive extension for ${ archiveFileName } `
269+ ) ;
270+
271+ return false ;
272+ }
273+ }
274+
262275 const tmpBasePath = join ( tmpdir ( ) , "pico-sdk" ) ;
263276 await mkdir ( tmpBasePath , { recursive : true } ) ;
264277 const archiveFilePath = join ( tmpBasePath , archiveFileName ) ;
@@ -608,8 +621,8 @@ export async function downloadAndInstallSDK(
608621 * @param redirectURL An optional redirect URL to download the asset
609622 * from (used to follow redirects recursively)
610623 * @returns A promise that resolves to true if the asset was downloaded and installed successfully
611- */
612- async function downloadAndInstallGithubAsset (
624+ */ // TODO: do not export
625+ export async function downloadAndInstallGithubAsset (
613626 version : string ,
614627 releaseVersion : string ,
615628 repo : GithubRepository ,
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export enum GithubRepository {
2626 tools = 3 ,
2727 picotool = 4 ,
2828 rust = 5 ,
29+ rsTools = 6 ,
2930}
3031
3132/**
@@ -71,6 +72,8 @@ export function ownerOfRepository(repository: GithubRepository): string {
7172 return "ninja-build" ;
7273 case GithubRepository . rust :
7374 return "rust-lang" ;
75+ case GithubRepository . rsTools :
76+ return "paulober" ;
7477 }
7578}
7679
@@ -95,6 +98,8 @@ export function repoNameOfRepository(repository: GithubRepository): string {
9598 return "picotool" ;
9699 case GithubRepository . rust :
97100 return "rust" ;
101+ case GithubRepository . rsTools :
102+ return "pico-vscode-rs-tools" ;
98103 }
99104}
100105
@@ -316,6 +321,10 @@ export async function getRustReleases(): Promise<string[]> {
316321 return getReleases ( GithubRepository . rust ) ;
317322}
318323
324+ export async function getRustToolsReleases ( ) : Promise < string [ ] > {
325+ return getReleases ( GithubRepository . rsTools ) ;
326+ }
327+
319328/**
320329 * Get the release data for a specific tag from
321330 * the GitHub RESY API.
You can’t perform that action at this time.
0 commit comments