-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.m
56 lines (43 loc) · 1.59 KB
/
setup.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
function setup(str1,str2)
rootDir = pwd;
addpath(pwd)
libsPath = genpath([rootDir '/lib']); % all libs/dependencies live here for this project
if nargin > 0
switch str1
case 'install'
addpath(libsPath, '-begin');
disp('Successfully added libs to path.')
statusStr = [str1 'ed'];
case 'remove'
warning('off')
rmpath(libsPath);
disp('Successfully removed libs from path.')
warning('on')
statusStr = [str1 'd'];
otherwise
disp('Unrecognized arg 1. Try >> setup add OR >> setup remove.')
disp('Setup incomplete.')
return
end
if nargin > 1
switch str2
case 'save'
warning('You are about to make permanent changes to search path.')
prompt = 'Would you like to continue? (y/n): ';
str = input(prompt,'s');
if strcmp(str, 'y')
savepath
disp(['Permanently ' statusStr ' project libs on search path.'])
elseif strcmp(str, 'n')
disp('Canceling permanent save.')
else
disp('Unrecognized input. Exiting without saving path')
return
end
otherwise
disp('Unrecognized arg 2. Try >> setup add save OR >> setup remove save.')
return
end
end
else
end