Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function to get brain entropy version #636

Merged
merged 4 commits into from
Aug 10, 2023
Merged
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
33 changes: 31 additions & 2 deletions toolbox/core/bst_plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
PlugDesc(end).AutoLoad = 1;
PlugDesc(end).CompiledStatus = 2;
PlugDesc(end).LoadFolders = {'*'};
PlugDesc(end).GetVersionFcn = @be_versions;
PlugDesc(end).DeleteFiles = {'docs', '.github'};

% === I/O: ADI-SDK === ADInstrument SDK for reading LabChart files
Expand Down Expand Up @@ -732,6 +733,12 @@ function Configure(PlugDesc)
disp(['BST> Checking latest online version for ' PlugName '...']);
str = bst_webread('https://raw.githubusercontent.com/Nirstorm/nirstorm/master/bst_plugin/VERSION');
Version = strtrim(str(9:end));
case 'brainentropy'
bst_progress('text', ['Checking latest online version for ' PlugName '...']);
disp(['BST> Checking latest online version for ' PlugName '...']);
str = bst_webread('https://raw.githubusercontent.com/multifunkim/best-brainstorm/master/best/VERSION.txt');
str = strsplit(str,'\n');
Version = strtrim(str{1});
otherwise
% If downloading from github: Get last GitHub commit SHA
if isGithubMaster(URLzip)
Expand Down Expand Up @@ -2208,12 +2215,34 @@ function Configure(PlugDesc)
strDate = '';
strPath = '';
end
% Cut version string (short github SHA)
if (length(PlugDesc(iPlug).Version) > 13)
% Get installed version
if (length(PlugDesc(iPlug).Version) > 13) % Cut version string (short github SHA)
plugVer = ['git @', PlugDesc(iPlug).Version(1:7)];
else
plugVer = PlugDesc(iPlug).Version;
end
% Get installed version with GetVersionFcn
if isempty(plugVer) && isfield(PlugDesc(iPlug),'GetVersionFcn') && ~isempty(PlugDesc(iPlug).GetVersionFcn)
% Load plugin if needed
tmpLoad = 0;
if ~PlugDesc(iPlug).isLoaded
tmpLoad = 1;
Load(PlugDesc(iPlug), 0);
end
try
if ischar(PlugDesc(iPlug).GetVersionFcn)
plugVer = eval(PlugDesc(iPlug).GetVersionFcn);
elseif isa(PlugDesc(iPlug).GetVersionFcn, 'function_handle')
plugVer = feval(PlugDesc(iPlug).GetVersionFcn);
end
catch
disp(['BST> Could not get installed version with callback: ' PlugDesc(iPlug).GetVersionFcn]);
end
% Unload plugin
if tmpLoad
Unload(PlugDesc(iPlug), 0);
end
end
% Assemble plugin text row
strList = [strList strLoaded, ...
PlugDesc(iPlug).Name, repmat(' ', 1, maxName-length(PlugDesc(iPlug).Name)) ...
Expand Down