Mercurial > repos > public > matlab_path_manager
changeset 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 |
files | +mpm/MatlabPathManager.m +mpm/install_location.m |
diffstat | 2 files changed, 11 insertions(+), 8 deletions(-) [+] |
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
--- a/+mpm/install_location.m Tue Sep 18 11:52:14 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -function p = install_location() - nameCurrentFile = mfilename('fullpath'); - pathParts = split(nameCurrentFile, filesep); - - p = join(pathParts(1:end-2), filesep); - p = p{1}; -end