view +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 source

% Leave project in current folder
function leave(d)
    if ~exist('d', 'var') || isempty(d)
        d = 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)
end