From 6c653f9f5846aa246fd3c7b444349efd650d5c76 Mon Sep 17 00:00:00 2001 From: mw-hrastega <48831250+mw-hrastega@users.noreply.github.com> Date: Tue, 13 Apr 2021 11:18:09 -0400 Subject: [PATCH 1/2] Clarify how to run files not on the MATLAB path --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44c9990..f214fa7 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,9 @@ Input | Description MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the build to fail. To ensure that the build fails in certain conditions, use the [`assert`](https://www.mathworks.com/help/matlab/ref/assert.html) or [`error`](https://www.mathworks.com/help/matlab/ref/error.html) functions. -When you use this action, all of the required files must be on the MATLAB search path. +When you use this action, all of the required files must be on the MATLAB search path. If your script or function is located in a folder in the root of your repository, you can use the [`addpath`](https://www.mathworks.com/help/matlab/ref/addpath.html), [`cd`](https://www.mathworks.com/help/matlab/ref/cd.html), or [`run`](https://www.mathworks.com/help/matlab/ref/run.html) functions to ensure that the folder is on the path when the script or function is invoked. For example, to run `myscript.m` in a folder `myfolder` in the root of the repository, you can specify `command` like this: + +`command: addpath('myfolder'), myscript` ## Notes When you use the **Run MATLAB Command** action, you execute third-party code that is licensed under separate terms. From fbfa55007a90b29a16a3d61ad501efddf1b26ed5 Mon Sep 17 00:00:00 2001 From: mw-hrastega <48831250+mw-hrastega@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:30:00 -0400 Subject: [PATCH 2/2] Rephrase the paragraph on adding files to path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f214fa7..93c2895 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Input | Description MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the build to fail. To ensure that the build fails in certain conditions, use the [`assert`](https://www.mathworks.com/help/matlab/ref/assert.html) or [`error`](https://www.mathworks.com/help/matlab/ref/error.html) functions. -When you use this action, all of the required files must be on the MATLAB search path. If your script or function is located in a folder in the root of your repository, you can use the [`addpath`](https://www.mathworks.com/help/matlab/ref/addpath.html), [`cd`](https://www.mathworks.com/help/matlab/ref/cd.html), or [`run`](https://www.mathworks.com/help/matlab/ref/run.html) functions to ensure that the folder is on the path when the script or function is invoked. For example, to run `myscript.m` in a folder `myfolder` in the root of the repository, you can specify `command` like this: +When you use this action, all of the required files must be on the MATLAB search path. If your script or function is not in the root of your repository, you can use the [`addpath`](https://www.mathworks.com/help/matlab/ref/addpath.html), [`cd`](https://www.mathworks.com/help/matlab/ref/cd.html), or [`run`](https://www.mathworks.com/help/matlab/ref/run.html) functions to ensure that it is on the path when invoked. For example, to run `myscript.m` in a folder `myfolder` located in the root of the repository, you can specify `command` like this: `command: addpath('myfolder'), myscript`