Mercurial > repos > public > matlab_path_manager
comparison +mpm/MatlabPathManager.m @ 24:fdad9fe450c5
Move install location function into the MpM class
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 18 Sep 2018 11:55:11 +0200 |
parents | 0b4be0d4e207 |
children | e2c18217aee0 |
comparison
equal
deleted
inserted
replaced
23:0b4be0d4e207 | 24:fdad9fe450c5 |
---|---|
6 | 6 |
7 methods | 7 methods |
8 function obj = MatlabPathManager() | 8 function obj = MatlabPathManager() |
9 end | 9 end |
10 | 10 |
11 function p = installLocation(obj) | |
12 nameCurrentFile = mfilename('fullpath'); | |
13 pathParts = split(nameCurrentFile, filesep); | |
14 | |
15 p = join(pathParts(1:end-2), filesep); | |
16 p = p{1}; | |
17 end | |
18 | |
11 function p = stateFilePath(obj) | 19 function p = stateFilePath(obj) |
12 p = fullfile(mpm.install_location(), obj.stateFileName); | 20 p = fullfile(obj.installLocation(), obj.stateFileName); |
13 end | 21 end |
14 | 22 |
15 % Load a given subpath into the state file and the matlab path and do savepath(), atomically | 23 % Load a given subpath into the state file and the matlab path and do savepath(), atomically |
16 function loadSubpath(obj, p) | 24 function loadSubpath(obj, p) |
17 state = mpm.PersistentState(obj.stateFilePath); | 25 state = mpm.PersistentState(obj.stateFilePath); |
124 obj.unload(sp{i}); | 132 obj.unload(sp{i}); |
125 end | 133 end |
126 end | 134 end |
127 end | 135 end |
128 end | 136 end |
137 | |
138 % TODO: Organize order of methods |