Skip to content

Commit a01189a

Browse files
Restrict supported releases (#65)
1 parent 180c8e5 commit a01189a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/install.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import * as path from "path";
2020
*/
2121
export async function install(platform: string, architecture: string, release: string, products: string[]) {
2222
const releaseInfo = await matlab.getReleaseInfo(release);
23+
if (releaseInfo.name < "r2020b") {
24+
return Promise.reject(Error(`Release '${releaseInfo.name}' is not supported. Use 'R2020b' or a later release.`));
25+
}
2326

2427
// Install runtime system dependencies for MATLAB on Linux
2528
if (platform === "linux") {

src/install.unit.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ describe("install procedure", () => {
9292
expect(setOutputMock).toHaveBeenCalledTimes(1);
9393
});
9494

95+
it("rejects for unsupported MATLAB release", async () => {
96+
matlabGetReleaseInfoMock.mockResolvedValue({
97+
name: "r2020a",
98+
version: "9.8.0",
99+
updateNumber: "latest"
100+
});
101+
await expect(install.install(platform, arch, "r2020a", products)).rejects.toBeDefined();
102+
});
103+
95104
it("rejects for invalid MATLAB version", async () => {
96105
matlabGetReleaseInfoMock.mockRejectedValue(Error("oof"));
97106
await expect(doInstall()).rejects.toBeDefined();

0 commit comments

Comments
 (0)