-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDepMatUpdate.m
40 lines (32 loc) · 1.08 KB
/
DepMatUpdate.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
function DepMatUpdate(repoList, varargin)
% DepMatUpdate. Clones or updates all repositories in a DepMatRepo list
%
%
%
% Licence
% -------
% Part of DepMat. https://github.com/tomdoel/depmat
% Author: Tom Doel, 2015. www.tomdoel.com
% Distributed under the MIT licence. Please see website for details.
%
forcePathUpdate = nargin > 1 && strcmp(varargin{1}, 'force');
rootSourceDir = fullfile(getUserDirectory(), 'depmat', 'Source');
depMat = DepMat(repoList, rootSourceDir);
if ~depMat.isGitInstalled()
msgbox('Cannot find git');
return;
end
anyChanged = depMat.cloneOrUpdateAll();
repoDirList = depMat.RepoDirList;
repoNameList = depMat.RepoNameList;
forcePathUpdate = forcePathUpdate || anyChanged;
DepMatAddPaths(repoDirList, repoNameList, forcePathUpdate);
end
function home_directory = getUserDirectory()
% Returns a path to the user's home folder
if (ispc)
home_directory = getenv('USERPROFILE');
else
home_directory = getenv('HOME');
end
end