Skip to content

Commit

Permalink
Merge pull request #135 from matlab-actions/fix_130
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahila authored Feb 25, 2025
2 parents 250e572 + f17c71c commit b41cf6a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,12 @@ jobs:
with:
release: ${{ matrix.release }}
products: ${{ matrix.products }}
- name: Call setup MATLAB again with different release # should not error as in issue 130
uses: ./
with:
release: R2023b
- name: Check MATLAB version
uses: matlab-actions/run-command@v2
with:
command: matlabVer = ver('matlab'); assert(strcmp(matlabVer.Release,'(R2023b)'));

11 changes: 11 additions & 0 deletions src/mpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as exec from "@actions/exec";
import * as tc from "@actions/tool-cache";
import {rmRF} from "@actions/io";
import * as path from "path";
import * as fs from 'fs';
import * as matlab from "./matlab";
import properties from "./properties.json";

Expand Down Expand Up @@ -37,6 +38,16 @@ export async function setup(platform: string, architecture: string): Promise<str
return Promise.reject(Error("Unable to find runner temporary directory."));
}
let mpmDest = path.join(runner_temp, `mpm${ext}`);

// Delete mpm file if it exists
if (fs.existsSync(mpmDest)) {
try {
fs.unlinkSync(mpmDest);
} catch (err) {
return Promise.reject(Error(`Failed to delete existing mpm file: ${err}`));
}
}

let mpm: string = await tc.downloadTool(mpmUrl, mpmDest);

if (platform !== "win32") {
Expand Down

0 comments on commit b41cf6a

Please sign in to comment.