Skip to content
Snippets Groups Projects

Change search path for config files

Merged Lemmer, Jan requested to merge 95-location-config-file into development
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
+ 11
3
@@ -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'];
Loading