-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2022, The MathWorks, Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. In all cases, the software is, and all modifications and derivatives of the | ||
software shall be, licensed to you solely for use in conjunction with | ||
MathWorks products and service offerings. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2013 Google. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following disclaimer | ||
in the documentation and/or other materials provided with the | ||
distribution. | ||
* Neither the name of Google Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as matlab from "./matlab"; | ||
export { matlab }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Helper interface to represent a MATLAB script. | ||
*/ | ||
export interface HelperScript { | ||
dir: string; | ||
command: string; | ||
} | ||
/** | ||
* Type of a function that executes a command on a runner and returns the error | ||
* code. | ||
*/ | ||
export declare type ExecFn = (command: string, args?: string[]) => Promise<number>; | ||
/** | ||
* Generate a MATLAB script in the temporary directory that runs a command in | ||
* the workspace. | ||
* | ||
* @param workspaceDir CI job workspace directory | ||
* @param command MATLAB command to run | ||
*/ | ||
export declare function generateScript(workspaceDir: string, command: string): Promise<HelperScript>; | ||
/** | ||
* Run a HelperScript in MATLAB. | ||
* | ||
* Create the HelperScript using `generateScript`. | ||
* | ||
* @param hs HelperScript pointing to the script containing the command | ||
* @param platform Operating system of the runner (e.g., "win32" or "linux") | ||
* @param architecture Architecture of the runner (e.g., "x64") | ||
* @param fn ExecFn that will execute a command on the runner | ||
*/ | ||
export declare function runCommand(hs: HelperScript, platform: string, architecture: string, fn: ExecFn, args?: string[]): Promise<void>; | ||
/** | ||
* Get the path of the script containing RunMATLABCommand for the host OS. | ||
* | ||
* @param platform Operating system of the runner (e.g., "win32" or "linux") | ||
* @param architecture Architecture of the runner (e.g., "x64") | ||
*/ | ||
export declare function getRunMATLABCommandScriptPath(platform: string, architecture: string): string; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Generate MATLAB command for changing directories and calling a command in it. | ||
* | ||
* @param dir Directory to change to. | ||
* @param command Command to run in directory. | ||
* @returns MATLAB command. | ||
*/ | ||
export declare function cdAndCall(command: string): string; | ||
/** | ||
* Convert a path-like string to MATLAB character vector literal. | ||
* | ||
* @param s Input string. | ||
* @returns Input string in MATLAB character vector literal. | ||
*/ | ||
export declare function pathToCharVec(s: string): string; | ||
/** | ||
* Convert an identifier (i.e., a script name) to one that is callable by MATLAB. | ||
* | ||
* @param s Input identifier. | ||
*/ | ||
export declare function safeName(s: string): string; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.