Skip to content

Commit c59e3a4

Browse files
committed
revert plugins path logic
1 parent 3cbbc37 commit c59e3a4

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/buildtool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export interface RunBuildOptions {
77
}
88

99
export function generateCommand(options: RunBuildOptions): string {
10-
let command: string = "buildtool"
10+
const pluginsPath = path.join(__dirname,"plugins").replaceAll("'","''");
11+
let command: string = "addpath('"+ pluginsPath +"'); buildtool"
1112
if (options.Tasks) {
1213
command = command + " " + options.Tasks;
1314
}

src/buildtool.unit.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
// Copyright 2022-2024 The MathWorks, Inc.
22

3+
import * as path from "path";
34
import * as buildtool from "./buildtool";
45

56
describe("command generation", () => {
7+
const command = "addpath('"+ path.join(__dirname, "plugins").replaceAll("'","''") +"'); buildtool"
68
it("buildtool invocation with unspecified tasks and build options", () => {
79
const options: buildtool.RunBuildOptions = {
810
Tasks: "",
911
BuildOptions: "",
1012
};
1113

1214
const actual = buildtool.generateCommand(options);
13-
expect(actual).toBe("buildtool")
15+
expect(actual).toBe(command)
1416
});
1517

1618
it("buildtool invocation with tasks specified", () => {
@@ -19,7 +21,7 @@ describe("command generation", () => {
1921
};
2022

2123
const actual = buildtool.generateCommand(options);
22-
expect(actual).toBe("buildtool compile test")
24+
expect(actual).toBe(command + " compile test")
2325
});
2426

2527
it("buildtool invocation with only build options", () => {
@@ -29,7 +31,7 @@ describe("command generation", () => {
2931
};
3032

3133
const actual = buildtool.generateCommand(options);
32-
expect(actual).toBe("buildtool -continueOnFailure -skip check")
34+
expect(actual).toBe(command + " -continueOnFailure -skip check")
3335
});
3436

3537
it("buildtool invocation with specified tasks and build options", () => {
@@ -39,6 +41,6 @@ describe("command generation", () => {
3941
};
4042

4143
const actual = buildtool.generateCommand(options);
42-
expect(actual).toBe("buildtool compile test -continueOnFailure -skip check")
44+
expect(actual).toBe(command + " compile test -continueOnFailure -skip check")
4345
});
4446
});

0 commit comments

Comments
 (0)