Skip to content

Commit e0aef80

Browse files
authored
Add runtime directory to system PATH for windows (#141)
1 parent 38d812c commit e0aef80

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/install.ts

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export async function install(platform: string, architecture: string, release: s
5454
core.setOutput('matlabroot', destination);
5555

5656
await matlab.setupBatch(platform, matlabArch);
57+
58+
if (platform === "win32") {
59+
if (matlabArch === "x86") {
60+
core.addPath(path.join(destination, "runtime", "win32"));
61+
} else {
62+
core.addPath(path.join(destination, "runtime", "win64"));
63+
}
64+
}
5765
});
5866

5967
return;

src/install.unit.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,12 @@ describe("install procedure", () => {
157157
expect(matlabSetupBatchMock).toHaveBeenCalledWith("darwin", "x64");
158158
expect(mpmSetupMock).toHaveBeenCalledWith("darwin", "x64");
159159
});
160+
161+
it("adds runtime path for Windows platform", async () => {
162+
await expect(install.install("win32", arch, release, products, useCache)).resolves.toBeUndefined();
163+
expect(addPathMock).toHaveBeenCalledTimes(2);
164+
expect(addPathMock).toHaveBeenCalledWith(expect.stringContaining("bin"));
165+
expect(addPathMock).toHaveBeenCalledWith(expect.stringContaining("runtime"));
166+
});
167+
160168
});

0 commit comments

Comments
 (0)