diff +mpm/MatlabPathManager.m @ 30:d9f899b1dfd0

Add status command and make subpathIsActive a static method
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 18 Sep 2018 14:15:23 +0200
parents 91724783a931
children cbeef8175d59
line wrap: on
line diff
--- a/+mpm/MatlabPathManager.m	Tue Sep 18 13:19:38 2018 +0200
+++ b/+mpm/MatlabPathManager.m	Tue Sep 18 14:15:23 2018 +0200
@@ -90,7 +90,7 @@
             sp = obj.projectSubpaths(projectFolder);
 
             for i = 1:length(sp)
-                if ~subpathIsActive(fullfile(projectFolder,sp{i}), mpath)
+                if ~obj.subpathIsActive(fullfile(projectFolder,sp{i}), mpath)
                     b = false;
                     return;
                 end
@@ -107,24 +107,26 @@
             end
         end
     end
-end
 
-% Test if the path p is active among folders in path with the same final foldername
-function b = subpathIsActive(p, paths)
-    pathparts = split(p, filesep);
-    foldername = pathparts{end};
+    methods (Static)
+        % Test if the path p is active among folders in path with the same final foldername
+        function b = subpathIsActive(p, paths)
+            pathparts = split(p, filesep);
+            foldername = pathparts{end};
 
-    for i = 1:length(paths)
-        if ~endsWith(paths{i}, foldername)
-            % Ignore files with different end foldername
-            continue
-        end
+            for i = 1:length(paths)
+                if ~endsWith(paths{i}, foldername)
+                    % Ignore files with different end foldername
+                    continue
+                end
 
-        b = strcmp(p, paths{i});
-        return
+                b = strcmp(p, paths{i});
+                return
+            end
+
+            b = false;
+        end
     end
-
-    b = false;
 end
 
 % TODO: Organize order of methods