Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit 3f62128

Browse files
Handle case where user interrupts the initialize installs.
1 parent 02960f1 commit 3f62128

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

+ghtb/initialize.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ function initialize(varargin)
2222
if ~isempty(INVOKED) && ~force
2323
return
2424
end
25-
% set cache
26-
INVOKED = true;
2725
% require certain toolboxes
2826
requiredToolboxes = {...
2927
struct(...
3028
'Name', 'compareVersions', ...
3129
'ResolveTarget', 'guzman-raphael/compareVersions'...
3230
) ...
3331
};
34-
ghtb.require(requiredToolboxes, 'prompt', prompt);
32+
ghtb.require(requiredToolboxes, 'prompt', prompt, 'resolveGHToolboxDeps', false);
33+
% set cache
34+
INVOKED = true;
3535
end

+ghtb/require.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function require(requiredToolboxes, varargin)
1212
% Version[optional, string]. Version specified 'pins' it
1313
% i.e. version equals operation. See below for examples.
1414
% prompt[optional, default=true]: (boolean) Whether to silently install or use prompts.
15+
% resolveGHToolboxDeps[optional, default=true]: (boolean) Resolve dependencies related
16+
% to GHToolbox.
1517
% Examples:
1618
% requiredToolboxes = {...
1719
% struct(...
@@ -28,10 +30,14 @@ function require(requiredToolboxes, varargin)
2830
% ghtb.require(requiredToolboxes, 'prompt', false)
2931
p = inputParser;
3032
addOptional(p, 'prompt', true);
33+
addOptional(p, 'resolveGHToolboxDeps', true);
3134
parse(p, requiredToolboxes, varargin{:});
3235
prompt = p.Results.prompt;
36+
resolveGHToolboxDeps = p.Results.resolveGHToolboxDeps;
3337
% resolve GHToolbox dependencies
34-
ghtb.initialize('prompt', prompt);
38+
if resolveGHToolboxDeps
39+
ghtb.initialize('prompt', prompt);
40+
end
3541
% determine installed toolboxes
3642
try
3743
toolboxes = table2struct(matlab.addons.installedAddons);

+ghtb/version.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
% https://www.github.com/datajoint/GHToolbox.git
1212
% License:
1313
% MIT (use/copy/change/redistribute at your own risk)
14-
v = '1.0.11';
14+
v = '1.0.12';
1515
if nargout
1616
varargout{1}=v;
1717
else

GHToolbox.mltbx

97 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)