Skip to content

Commit ebd7ab9

Browse files
author
Build Action
committed
Build for d2edaa2
1 parent d2edaa2 commit ebd7ab9

File tree

10 files changed

+245
-0
lines changed

10 files changed

+245
-0
lines changed

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as matlab from "./matlab";
2+
export { matlab };

lib/index.js

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/matlab.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Helper interface to represent a MATLAB script.
3+
*/
4+
export interface HelperScript {
5+
dir: string;
6+
command: string;
7+
}
8+
/**
9+
* Type of a function that executes a command on a runner and returns the error
10+
* code.
11+
*/
12+
export declare type ExecFn = (command: string, args?: string[]) => Promise<number>;
13+
/**
14+
* Generate a MATLAB script in the temporary directory that runs a command in
15+
* the workspace.
16+
*
17+
* @param workspaceDir CI job workspace directory
18+
* @param command MATLAB command to run
19+
*/
20+
export declare function generateScript(workspaceDir: string, command: string): Promise<HelperScript>;
21+
/**
22+
* Run a HelperScript in MATLAB.
23+
*
24+
* Create the HelperScript using `generateScript`.
25+
*
26+
* @param hs HelperScript pointing to the script containing the command
27+
* @param platform Operating system of the runner (e.g., "win32" or "linux")
28+
* @param fn ExecFn that will execute a command on the runner
29+
*/
30+
export declare function runCommand(hs: HelperScript, platform: string, fn: ExecFn): Promise<void>;
31+
/**
32+
* Get the path of the script containing RunMATLABCommand for the host OS.
33+
*
34+
* @param platform Operating system of the runner (e.g., "win32" or "linux")
35+
*/
36+
export declare function getRmcPath(platform: string): string;

lib/matlab.js

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/matlab.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/script.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Generate MATLAB command for changing directories and calling a command in it.
3+
*
4+
* @param dir Directory to change to.
5+
* @param command Command to run in directory.
6+
* @returns MATLAB command.
7+
*/
8+
export declare function cdAndCall(dir: string, command: string): string;
9+
/**
10+
* Convert a path-like string to MATLAB character vector literal.
11+
*
12+
* @param s Input string.
13+
* @returns Input string in MATLAB character vector literal.
14+
*/
15+
export declare function pathToCharVec(s: string): string;
16+
/**
17+
* Convert an identifier (i.e., a script name) to one that is callable by MATLAB.
18+
*
19+
* @param s Input identifier.
20+
*/
21+
export declare function safeName(s: string): string;

lib/script.js

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/script.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)