Commit 35d9fa4a authored by Brad Kennedy's avatar Brad Kennedy
Browse files

2017-07-25 Brad Kennedy <bk@co60.ca>

    * CHANGELOG: Change changelog format to actually contain changes
    ensure you follow the format and put newer changes above this one

    * eegplugin_batch_context.m: Added version such that it generates it
    from the VERSION file in this directory
parent 41138f53
2017-07-25 Brad Kennedy <bk@co60.ca>
* CHANGELOG: Change changelog format to actually contain changes
ensure you follow the format and put newer changes above this one
* eegplugin_batch_context.m: Added version such that it generates it
from the VERSION file in this directory
\ No newline at end of file
v1.0.0
\ No newline at end of file
......@@ -48,10 +48,12 @@
function eegplugin_batch_context(fig,try_strings,catch_strings)
function version = eegplugin_batch_context(fig,try_strings,catch_strings)
version = get_version('batch_context', 'batch_context1.0.0');
%% start up
addpath(genpath(fileparts(which('eegplugin_batch_context.m'))));
addpath(genpath(fileparts(which(mfilename()))));
%--------------------------------------------------------------------------
% Get File menu handle...
......@@ -87,3 +89,25 @@ uimenu(batchmenu,'Label','Batch configuration', ...
uimenu(batchmenu,'Label','Context configuration', ...
'callback','context=pop_context_edit;');
end
function version = get_version(prefix, fallback)
version = fallback;
[curdir, ~, ~] = fileparts(which(mfilename()));
versionpath = fullfile(curdir, 'VERSION');
if ~exist(versionpath, 'file')
return;
end
fid = fopen(versionpath);
if fid == -1
return;
end
text = deblank(fread(fid, '*char')');
fclose(fid);
if text(1) == 'v'
version = [prefix text(2:end)];
else
version = [prefix text];
end
end
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