Mercurial > repos > public > matlab_path_manager
annotate +mpm/verify.m @ 37:01e81c77bca1
Add checks to avoid errors when calling commands outside of a project folder
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 02 Nov 2018 14:43:27 +0100 |
parents | 647cd9e354bf |
children |
rev | line source |
---|---|
5
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 % Check if the current proejct settings are correct |
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 % The right version is in the path |
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 % The right version is at the top of the path |
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 % |
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 % Useful to put at the top of some scripts |
36
647cd9e354bf
Change variable naming in mpm.verify to make it more concisten with the other scripts
Jonatan Werpers <jonatan@werpers.com>
parents:
21
diff
changeset
|
6 function verify(projectFolder) |
647cd9e354bf
Change variable naming in mpm.verify to make it more concisten with the other scripts
Jonatan Werpers <jonatan@werpers.com>
parents:
21
diff
changeset
|
7 if ~exist('projectFolder', 'var') || isempty(projectFolder) |
647cd9e354bf
Change variable naming in mpm.verify to make it more concisten with the other scripts
Jonatan Werpers <jonatan@werpers.com>
parents:
21
diff
changeset
|
8 projectFolder = pwd; |
6
19c4af287596
Fix default values for relative part
Jonatan Werpers <jonatan@werpers.com>
parents:
5
diff
changeset
|
9 end |
19c4af287596
Fix default values for relative part
Jonatan Werpers <jonatan@werpers.com>
parents:
5
diff
changeset
|
10 |
21
02c290e2018c
Refactor ui functions to use the MPM class. Not tested
Jonatan Werpers <jonatan@werpers.com>
parents:
7
diff
changeset
|
11 m = mpm.MatlabPathManager(); |
36
647cd9e354bf
Change variable naming in mpm.verify to make it more concisten with the other scripts
Jonatan Werpers <jonatan@werpers.com>
parents:
21
diff
changeset
|
12 if ~m.verify(projectFolder) |
21
02c290e2018c
Refactor ui functions to use the MPM class. Not tested
Jonatan Werpers <jonatan@werpers.com>
parents:
7
diff
changeset
|
13 error('Subpaths are not correctly loaded. Try running mpm.checkin()'); |
5
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
14 end |
6c46515ee860
Add function for checking if the currently loaded paths are correct
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
15 end |