Mercurial > repos > public > matlab_path_manager
comparison +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 |
comparison
equal
deleted
inserted
replaced
20:ddf75f18509f | 21:02c290e2018c |
---|---|
1 % Leave project in current folder | 1 % Checkout a projects subpaths from the matlab path |
2 function leave(d) | 2 function checkout(projectFolder) |
3 if ~exist('d', 'var') || isempty(d) | 3 if ~exist('projectFolder', 'var') || isempty(projectFolder) |
4 d = ''; | 4 projectFolder = pwd; |
5 end | 5 end |
6 | 6 |
7 state = mpm.load_state(); | 7 m = mpm.MatlabPathManager(); |
8 | 8 m.checkout(projectFolder); |
9 sp = mpm.subpaths(d); | |
10 for i = 1:length(sp) | |
11 subpath = fullfile(pwd, sp{i}); | |
12 rmpath(subpath); | |
13 state.added_paths.remove(subpath); | |
14 end | |
15 | |
16 mpm.save_state(state); | |
17 end | 9 end |