Skip to content

Commit 8ed4216

Browse files
bronsolobronsolo
authored andcommitted
fix finding plotly wrapper directory logic
1 parent 1f021c8 commit 8ed4216

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

plotly/plotly_setup_aux/plotlycleanup.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,23 @@
2626
return
2727
end
2828

29+
% plotly toolbox directory
30+
plotlyToolboxDir = fullfile(matlabroot,'toolbox','plotly');
31+
2932
% find the location of all plotly/ directories
3033
dircount = 1;
3134
for d = 1:length(plotlyScriptDirs)
3235
%parse filepath string at the Plotly directory
3336
plotlyLoc = strfind(fileparts(plotlyScriptDirs{d}),fullfile('MATLAB-api','plotly'));
37+
plotlyToolboxLoc = strfind(fileparts(plotlyScriptDirs{d}),plotlyToolboxDir);
3438
if ~isempty(plotlyLoc)
3539
plotlyDirs{dircount} = fullfile(plotlyScriptDirs{d}(1:plotlyLoc-1),'MATLAB-api','plotly');
40+
elseif ~isempty(plotlyToolboxLoc)
41+
plotlyDirs{dircount} = plotlyToolboxDir;
3642
end
3743
dircount = dircount + 1;
3844
end
3945

40-
% plotly toolbox directory
41-
plotlyToolboxDir = fullfile(matlabroot,'toolbox','plotly');
42-
43-
% MATLAB toolbox plotly
44-
if exist(plotlyToolboxDir, 'dir');
45-
plotlyDirs{end+1} = plotlyToolboxDir;
46-
end
47-
4846
for d = 1:length(plotlyDirs)
4947

5048
% add plotlydirs to searchpath (will be removed in future once handled by plotlyupdate)

plotly/plotly_setup_aux/plotlyupdate.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,23 @@ function plotlyupdate(varargin)
6767
return
6868
end
6969

70+
% plotly toolbox directory
71+
plotlyToolboxDir = fullfile(matlabroot,'toolbox','plotly');
72+
7073
% find the location of all plotly/ directories
7174
dircount = 1;
7275
for d = 1:length(plotlyScriptDirs)
7376
%parse filepath string at the Plotly directory
7477
plotlyLoc = strfind(fileparts(plotlyScriptDirs{d}),fullfile('MATLAB-api','plotly'));
78+
plotlyToolboxLoc = strfind(fileparts(plotlyScriptDirs{d}),plotlyToolboxDir);
7579
if ~isempty(plotlyLoc)
7680
plotlyDirs{dircount} = fullfile(plotlyScriptDirs{d}(1:plotlyLoc-1),'MATLAB-api','plotly');
81+
elseif ~isempty(plotlyToolboxLoc)
82+
plotlyDirs{dircount} = plotlyToolboxDir;
7783
end
7884
dircount = dircount + 1;
7985
end
8086

81-
% plotly toolbox directory
82-
plotlyToolboxDir = fullfile(matlabroot,'toolbox','plotly');
83-
84-
% MATLAB toolbox plotly
85-
if exist(plotlyToolboxDir, 'dir');
86-
plotlyDirs{end+1} = plotlyToolboxDir;
87-
end
88-
8987
%----update if necessary----%
9088
if strcmp(pvLocal,pvRemote)
9189
fprintf(['\nYour Plotly API MATLAB Library v.' pvRemote ' is already up to date! \n\n'])

0 commit comments

Comments
 (0)