diff +mpm/leave.m @ 3:ce34182c274e

Add state
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 10 Sep 2018 15:19:55 +0200
parents a9795512f33a
children 19c4af287596
line wrap: on
line diff
--- a/+mpm/leave.m	Mon Sep 10 14:59:21 2018 +0200
+++ b/+mpm/leave.m	Mon Sep 10 15:19:55 2018 +0200
@@ -4,8 +4,14 @@
         d = pwd;
     end
 
+    state = mpm.load_state();
+
     sp = mpm.subpaths(d);
     for i = 1:length(sp)
-        rmpath(fullfile(pwd, sp{i}));
+        subpath = fullfile(pwd, sp{i});
+        rmpath(subpath);
+        state.added_paths.remove(subpath);
     end
+
+    mpm.save_state(state)
 end