Mercurial > repos > public > matlab_path_manager
diff +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 |
line wrap: on
line diff
--- a/+mpm/MatlabPathManager.m Tue Sep 18 11:52:14 2018 +0200 +++ b/+mpm/MatlabPathManager.m Tue Sep 18 11:55:11 2018 +0200 @@ -8,8 +8,16 @@ function obj = MatlabPathManager() end + function p = installLocation(obj) + nameCurrentFile = mfilename('fullpath'); + pathParts = split(nameCurrentFile, filesep); + + p = join(pathParts(1:end-2), filesep); + p = p{1}; + end + function p = stateFilePath(obj) - p = fullfile(mpm.install_location(), obj.stateFileName); + p = fullfile(obj.installLocation(), obj.stateFileName); end % Load a given subpath into the state file and the matlab path and do savepath(), atomically @@ -126,3 +134,5 @@ end end end + +% TODO: Organize order of methods