Skip to content

Commit ecc6c09

Browse files
committed
update how libraries are added to the path
1 parent ebe7b57 commit ecc6c09

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

init_spm_2_bids.m

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function init_spm_2_bids
1+
function init_spm_2_bids(add_dev)
22
%
33
% 1 - Check if version requirements
44
% are satisfied and the packages are
@@ -15,6 +15,10 @@
1515
%
1616
% (C) Copyright 2021 spm_2_bids developers
1717

18+
if nargin < 1
19+
add_dev = false;
20+
end
21+
1822
OCTAVE_VER = '4.0.3';
1923
MATLAB_VER = '8.6.0';
2024

@@ -53,7 +57,10 @@
5357

5458
end
5559

56-
add_dependencies();
60+
add_dependencies(add_dev);
61+
62+
pth = fileparts(mfilename('fullpath'));
63+
addpath(genpath(fullfile(pth, 'src')));
5764

5865
disp('Correct matlab/octave verions and added to the path!');
5966

@@ -90,11 +97,12 @@ function try_install_from_forge(package_name)
9097

9198
end
9299

93-
function add_dependencies()
100+
function add_dependencies(add_dev)
94101

95-
pth = fileparts(mfilename('fullpath'));
96-
addpath(fullfile(pth, 'lib', 'bids-matlab'));
97-
addpath(fullfile(pth, 'tests', 'utils'));
98-
addpath(genpath(fullfile(pth, 'src')));
102+
if add_dev
103+
pth = fileparts(mfilename('fullpath'));
104+
addpath(fullfile(pth, 'lib', 'bids-matlab'));
105+
addpath(fullfile(pth, 'lib', 'JSONio'));
106+
end
99107

100108
end

run_tests.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if isdir(fullfile(thisDir, 'lib', 'bids-matlab'))
66
addpath(fullfile(thisDir, 'lib', 'bids-matlab'));
7+
addpath(fullfile(thisDir, 'lib', 'JSONio'));
78
end
89

910
folderToCover = fullfile(thisDir, 'src');

0 commit comments

Comments
 (0)