diff +mpm/checkout.m @ 21:02c290e2018c

Refactor ui functions to use the MPM class. Not tested
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 17 Sep 2018 15:49:39 +0200
parents 309cc6c0cd75
children 01e81c77bca1
line wrap: on
line diff
--- a/+mpm/checkout.m	Mon Sep 17 15:46:16 2018 +0200
+++ b/+mpm/checkout.m	Mon Sep 17 15:49:39 2018 +0200
@@ -1,17 +1,9 @@
-% Leave project in current folder
-function leave(d)
-    if ~exist('d', 'var') || isempty(d)
-        d = '';
+% Checkout a projects subpaths from the matlab path
+function checkout(projectFolder)
+    if ~exist('projectFolder', 'var') || isempty(projectFolder)
+        projectFolder = pwd;
     end
 
-    state = mpm.load_state();
-
-    sp = mpm.subpaths(d);
-    for i = 1:length(sp)
-        subpath = fullfile(pwd, sp{i});
-        rmpath(subpath);
-        state.added_paths.remove(subpath);
-    end
-
-    mpm.save_state(state);
+    m = mpm.MatlabPathManager();
+    m.checkout(projectFolder);
 end