Skip to content

Commit 80640a3

Browse files
author
Sam Eagen
committed
Remove destination folder if mpm fails
1 parent 9918121 commit 80640a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mpm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as exec from "@actions/exec";
44
import * as tc from "@actions/tool-cache";
5+
import {rmRF} from "@actions/io";
56
import * as path from "path";
67
import * as matlab from "./matlab";
78
import properties from "./properties.json";
@@ -68,6 +69,9 @@ export async function install(mpmPath: string, release: matlab.Release, products
6869

6970
const exitCode = await exec.exec(mpmPath, mpmArguments);
7071
if (exitCode !== 0) {
72+
// Fully remove failed MATLAB installation for self-hosted runners
73+
await rmRF(destination);
74+
7175
return Promise.reject(Error(`Script exited with non-zero code ${exitCode}`));
7276
}
7377
return

0 commit comments

Comments
 (0)