Mercurial > repos > public > matlab_path_manager
diff +mpm/checkin.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/checkin.m Mon Sep 17 15:46:16 2018 +0200 +++ b/+mpm/checkin.m Mon Sep 17 15:49:39 2018 +0200 @@ -1,17 +1,9 @@ -% Set project to current folder -function set(d) - if ~exist('d', 'var') || isempty(d) - d = ''; +% Checkin a projects subpaths to the matlab path +function checkin(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}); - addpath(subpath); - state.added_paths(subpath) = true; - end - - mpm.save_state(state); + m = mpm.MatlabPathManager(); + m.checkin(projectFolder); end