Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix getting version of externally installed toolchain #245

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/one-click/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ 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 +359,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 +655,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 +675,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
Loading