From 7e9161de81c3d0934f9ad3a26ef2e4f75015dd84 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Thu, 13 Feb 2025 13:58:30 +0530 Subject: [PATCH 1/3] Add check if mpm already exists --- src/mpm.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/mpm.ts b/src/mpm.ts index 5d3efec..24ecd12 100644 --- a/src/mpm.ts +++ b/src/mpm.ts @@ -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"; @@ -37,15 +38,21 @@ export async function setup(platform: string, architecture: string): Promise Date: Thu, 13 Feb 2025 13:59:15 +0530 Subject: [PATCH 2/3] Add test for calling setup-matlab twice --- .github/workflows/bat.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/bat.yml b/.github/workflows/bat.yml index 350a91f..69f0ba6 100644 --- a/.github/workflows/bat.yml +++ b/.github/workflows/bat.yml @@ -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)')); + \ No newline at end of file From f17c71c91e33a0b2f311853cfdc64c4da43b20c9 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:36:32 +0530 Subject: [PATCH 3/3] Delete mpm file if it exists --- src/mpm.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mpm.ts b/src/mpm.ts index 24ecd12..ccd502e 100644 --- a/src/mpm.ts +++ b/src/mpm.ts @@ -38,21 +38,25 @@ export async function setup(platform: string, architecture: string): Promise