Commit 9067871a authored by ac 20's avatar ac 20

ljsPath find config.js

parent a75aaa90
......@@ -3,4 +3,10 @@ function ljsPath=getLeverjsPath(file)
thisFile=mfilename('fullpath');
[thisFolder,~,~]=fileparts(thisFile);
ljsPath=fullfile(thisFolder,'..','leverjs',file);
\ No newline at end of file
ljsPath=fullfile(thisFolder,'..','leverjs',file);
if ~exist(ljsPath,'file')
ljsPath=fullfile(thisFolder,'..',file);
end
if ~exist(ljsPath,'file')
fprintf(2,'getLeverjsPath:: could not locate %s\n',file);
end
\ No newline at end of file
......@@ -8,15 +8,10 @@ end
if ~isempty(timerVal)
elapsedTime=toc(timerVal);
end
if isempty(timerVal) || isempty(configLevel) || elapsedTime>10
% read from config
if exist('../config.js','file')
fname='../config.js';
elseif exist('./config.js','file')
fname='./config.js';
else
fname=[];
end
fname=getLeverjsPath('config.js');
configLevel=1;
if ~isempty(fname)
fid=fopen(fname,'r');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment