Skip to content

Commit

Permalink
fix getting version of externally installed toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLuGit committed Dec 30, 2024
1 parent c6e1a11 commit 3cef442
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/one-click/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export async function install(context: vscode.ExtensionContext) {
? semver.gte(semver.coerce(currentCliVersion) ?? "0.0.0", cliVersion)
: false;
const toolchainUpToDate = toolchainWorking
? semver.gte(currentToolchainVersion, toolchainVersion, { loose: true })
? semver.gte(semver.coerce(currentToolchainVersion) ?? "0.0.0", toolchainVersion, { loose: true })
: false;
await prosLogger.log(
"OneClick",
Expand All @@ -355,7 +355,7 @@ export async function install(context: vscode.ExtensionContext) {
`${
toolchainUpToDate
? "Toolchain is up to date"
: "To0lchain is not up to date"
: "Toolchain is not up to date"
}`,
toolchainUpToDate ? "INFO" : "WARNING"
);
Expand Down Expand Up @@ -651,6 +651,14 @@ export async function configurePaths(
"pros"
)
);
let [currentToolchainVersion, isToolchainOneClickInstall] =
await getToolchainVersion(
path.join(
`${addQuotes ? `"` : ""}${toolchainPath}${addQuotes ? `"` : ""}`,
"bin",
"arm-none-eabi-g++"
)
);
process.env["PROS_VSCODE_FLAGS"] = semver.gte(
semver.coerce(version) ?? "0.0.0",
"3.2.4"
Expand All @@ -663,6 +671,12 @@ export async function configurePaths(
isOneClickInstall ? "one-click" : "other means"
} with version ${version}`
);
await prosLogger.log(
"OneClick",
`Toolchain is installed through ${
isToolchainOneClickInstall ? "one-click" : "other means"
} with version ${currentToolchainVersion}`
);
console.log(`${isOneClickInstall} | ${version}`);

PATH_SEP = getOperatingSystem() === "windows" ? ";" : ":";
Expand Down
2 changes: 1 addition & 1 deletion src/one-click/installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function getToolchainVersion(
} catch {
try {
const { stdout } = await promisify(child_process.exec)(
`arm-none-eabi-g++ --version`,
`arm-none-eabi-g++ -dumpversion`,
{
env: {
...process.env,
Expand Down

0 comments on commit 3cef442

Please sign in to comment.