forked from PhilD001/biomechZoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanZoo.m
99 lines (78 loc) · 2.29 KB
/
cleanZoo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
function cleanZoo
% CLEANZOO removes outputs and folders created by running the various
% examples in the biomechZoo-help repository. Used prior to releasing a
% biomechZoo update
%
% NOTES
% - It is assumed that biomechZoo was properly added to the matlab path
% using startZoo
fld = fileparts(which('samplestudy_process.m')); % sample study root
cd(fld)
% Remove user generated folders and files from the sample study folder
%
sfld = fullfile(fld,'Data','zoo files (auto process)'); % sample study user gen data folder
if exist(sfld,'dir')
if strcmp(pwd,sfld)
cd(fld)
end
batchdisp(sfld,'deleting')
rmdir(sfld,'s');
end
fl = fullfile(fld,'Statistics','eventval.xlsx'); % sample study user gen stats file
if exist(fl,'file')
batchdisp(fl,'deleting')
delete(fl)
end
fl = fullfile(fld,'Statistics','eventval.xls'); % sample study user gen stats file
if exist(fl,'file')
batchdisp(fl,'deleting')
delete(fl)
end
% Remove user generated folders in the examples
%
indx = strfind(fld,'biomechZoo-help');
efld = fullfile(fld(1:indx+14),'examples');
sub = subdir(efld)';
for i = 1:length(sub)
if ~isempty(strfind(sub{i},'example data (processed)'))
fl = engine('fld',sub{i});
if ~isempty(fl)
delfile(fl)
end
if exist(sub{i},'dir')
rmdir(sub{i},'s')
end
elseif ~isempty(strfind(sub{i},'Statistics'))
fl = engine('fld',sub{i});
if ~isempty(fl)
delfile(fl)
end
if exist(sub{i},'dir')
rmdir(sub{i},'s')
end
end
end
% remove the prop file created by sampleprop_example
%
pfl = engine('fld',efld,'extension','.prop');
if ~isempty(pfl)
delfile(pfl)
end
% remove the stats file created by eventval_example
efl = engine('fld',efld,'extension','.xls');
if ~isempty(efl)
delfile(efl)
end
% remove some mac junk
%fl
rfld = fld(1:indx+14); % help files folder
zfld = fld(1:indx+9); % toolbox root
fl = engine('fld',rfld,'extension','.DS_store');
delfile(fl)
fl = engine('fld',zfld,'extension','.DS_store');
delfile(fl)
% remove some conflict junk
fl = engine('fld',rfld,'search file','conflict');
delfile(fl)
fl = engine('fld',zfld,'search file','conflicted copy');
delfile(fl)