Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Commit

Permalink
fix: use 2.13 binary version for 0.11.2 SNAPSHOT (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
dos65 authored Mar 14, 2022
1 parent e69dd2d commit b9248fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/__tests__/fetchMetals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("fetchMetals", () => {
expectedDep("2.12", "0.11.2")
);
expect(calcServerDependency("0.11.2-SNAPSHOT")).toBe(
expectedDep("2.12", "0.11.2-SNAPSHOT")
expectedDep("2.13", "0.11.2-SNAPSHOT")
);
expect(calcServerDependency("0.11.2-RC1")).toBe(
expectedDep("2.12", "0.11.2-RC1")
Expand All @@ -27,6 +27,9 @@ describe("fetchMetals", () => {
expect(calcServerDependency("0.11.3-RC1")).toBe(
expectedDep("2.13", "0.11.3-RC1")
);
expect(calcServerDependency("0.11.2+32-536ff4b1-SNAPSHOT")).toBe(
expectedDep("2.13", "0.11.2+32-536ff4b1-SNAPSHOT")
);
});
});
});
5 changes: 4 additions & 1 deletion src/fetchMetals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export function fetchMetals({
}

export function calcServerDependency(serverVersion: string): string {
const binaryVersion = semver.gt(serverVersion, "0.11.2") ? "2.13" : "2.12";
const use213 =
semver.gt(serverVersion, "0.11.2") ||
(serverVersion.startsWith("0.11.2") && serverVersion.endsWith("SNAPSHOT"));
const binaryVersion = use213 ? "2.13" : "2.12";
return serverVersion.includes(":")
? serverVersion
: `org.scalameta:metals_${binaryVersion}:${serverVersion}`;
Expand Down

0 comments on commit b9248fe

Please sign in to comment.