Skip to content

Commit ea9fb01

Browse files
authored
Merge pull request #10 from matlab-actions/mw-hrastega-patch-1
Clarify how to run files not on the MATLAB path
2 parents f44c6b5 + fbfa550 commit ea9fb01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ Input | Description
6060

6161
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.
6262

63-
When you use this action, all of the required files must be on the MATLAB search path.
63+
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:
64+
65+
`command: addpath('myfolder'), myscript`
6466

6567
## Notes
6668
When you use the **Run MATLAB Command** action, you execute third-party code that is licensed under separate terms.

0 commit comments

Comments
 (0)