Skip to content
Snippets Groups Projects
Commit f33473fc authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

Change search path for config files

config files in the plotID folder will be prefered
parent 820359a1
No related branches found
No related tags found
2 merge requests!62Introduce changes for V1.0 RC 1,!58Change search path for config files
Pipeline #653445 passed
......@@ -21,15 +21,23 @@ classdef config < handle
% reads config data from config file, if an error occurs the
% wizard is started by the catch block
obj.configFileName = configFileName;
try
txt = fileread(obj.configFileName);
try %Validity Check
tmp = what("PlotID");
tmp = strrep(tmp.path,'+PlotID','');
defaultConfigPath = fullfile(tmp,obj.configFileName);
if isfile(defaultConfigPath)
txt = fileread(defaultConfigPath);
else %search on path
txt = fileread(obj.configFileName);
end
obj.configData = jsondecode(txt);
assert(checkConfig(obj));
if isfield(obj.configData,'ExportPath')
obj.exportPath = obj.configData.ExportPath;
obj.configData.options.Location = 'exportPath';
end
catch
catch
msg = ['no valid config File with the filename ',...
obj.configFileName, ' found.' newline,...
'Please enter the required information manually'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment