Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions +dj/setup.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,40 @@ function setup(varargin)
try
ghtb.require(requiredToolboxes, 'prompt', prompt);
catch ME
if strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass')
installPromptMsg = {
'Toolbox ''%s'' did not meet the minimum requirements.'
'Would you like to proceed with an upgrade?'
};
if strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass') && (~prompt || strcmpi('yes',...
dj.internal.ask(sprintf(sprintf('%s\n', installPromptMsg{:}), 'GHToolbox'))))
% fetch
tmp_toolbox = [tempname '.mltbx'];
websave(tmp_toolbox, ['https://github.com/' requiredToolboxes{1}.ResolveTarget ...
'/releases/download/' ...
subsref(webread(['https://api.github.com/repos/' ...
requiredToolboxes{1}.ResolveTarget ...
'/releases/latest'], ...
weboptions('Timeout', 60)), ...
substruct('.', 'tag_name')) ...
'/GHToolbox.mltbx'], weboptions('Timeout', 60));
% install
try
matlab.addons.install(tmp_toolbox, 'overwrite');
catch ME
if strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass')
matlab.addons.toolbox.installToolbox(tmp_toolbox);
else
rethrow(ME);
end
end
% remove temp toolbox file
delete(tmp_toolbox);
% retrigger dependency validation
ghtb.require(requiredToolboxes, 'prompt', prompt);
elseif strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass')
GHToolboxMsg = {
'Toolbox ''GHToolbox'' did not meet the minimum minimum requirements.'
'Please install it via instructions in '
'''https://github.com/datajoint/GHToolbox'''.'
'Toolbox ''GHToolbox'' did not meet the minimum requirements.'
'Please proceed to install it.'
};
error('DataJoint:verifyGHToolbox:Failed', ...
sprintf('%s\n', GHToolboxMsg{:}));
Expand Down
2 changes: 1 addition & 1 deletion +dj/version.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function varargout = version
% report DataJoint version

v = struct('major',3,'minor',3,'bugfix',2);
v = struct('major',3,'minor',3,'bugfix',3);

if nargout
varargout{1}=v;
Expand Down
Binary file modified DataJoint.mltbx
Binary file not shown.
10 changes: 1 addition & 9 deletions LNX-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ services:
- |
mkdir ~/Documents
matlab -nodisplay -r "
websave([tempdir 'GHToolbox.mltbx'],\
['https://github.com/datajoint/GHToolbox' \
'/releases/download/' subsref(webread(['https://api.github.com/repos' \
'/datajoint/GHToolbox' \
'/releases/latest']),\
substruct('.', 'tag_name')) \
'/GHToolbox.mltbx']);\
matlab.addons.toolbox.installToolbox([tempdir 'GHToolbox.mltbx']);\
ghtb.install('DataJoint.mltbx');\
matlab.addons.toolbox.installToolbox('DataJoint.mltbx');\
addpath('tests');\
res=run(Main);\
disp(res);\
Expand Down
2 changes: 1 addition & 1 deletion tests/Prep.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function init(testCase)
clear functions;
addpath([testCase.test_root '/test_schemas']);
dj.set('suppressPrompt', true);

disp(dj.version);
curr_conn = dj.conn(testCase.CONN_INFO_ROOT.host, ...
testCase.CONN_INFO_ROOT.user, testCase.CONN_INFO_ROOT.password,'',true);
% create test users
Expand Down