Skip to content

Commit a15c27b

Browse files
committed
Added rustup support
Signed-off-by: paulober <[email protected]>
1 parent d0655bf commit a15c27b

File tree

5 files changed

+315
-170
lines changed

5 files changed

+315
-170
lines changed

src/commands/compileProject.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { EventEmitter } from "events";
33
import { CommandWithResult } from "./command.mjs";
44
import Logger from "../logger.mjs";
55
import Settings, { SettingsKey } from "../settings.mjs";
6-
import { ContextKeys } from "../contextKeys.mjs";
76
import State from "../state.mjs";
87

98
export default class CompileProjectCommand extends CommandWithResult<boolean> {

src/utils/download.mts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,19 @@ export async function downloadAndInstallArchive(
263263
return false;
264264
}
265265

266+
// TODO: find and eliminate issue why this is necesarry
267+
if (archiveExtension.length > 6) {
268+
archiveExtension = getArchiveExtension(archiveFileName);
269+
if (!archiveExtension) {
270+
Logger.error(
271+
LoggerSource.downloader,
272+
`Could not determine archive extension for ${archiveFileName}`
273+
);
274+
275+
return false;
276+
}
277+
}
278+
266279
const tmpBasePath = join(tmpdir(), "pico-sdk");
267280
await mkdir(tmpBasePath, { recursive: true });
268281
const archiveFilePath = join(tmpBasePath, archiveFileName);
@@ -612,8 +625,8 @@ export async function downloadAndInstallSDK(
612625
* @param redirectURL An optional redirect URL to download the asset
613626
* from (used to follow redirects recursively)
614627
* @returns A promise that resolves to true if the asset was downloaded and installed successfully
615-
*/
616-
async function downloadAndInstallGithubAsset(
628+
*/ // TODO: do not export
629+
export async function downloadAndInstallGithubAsset(
617630
version: string,
618631
releaseVersion: string,
619632
repo: GithubRepository,

src/utils/githubREST.mts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)