forked from gemini3d/mat_gemini-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.m
More file actions
29 lines (20 loc) · 730 Bytes
/
setup.m
File metadata and controls
29 lines (20 loc) · 730 Bytes
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
function setup()
%% configure paths to work with MatGemini
cwd = fileparts(mfilename("fullpath"));
addpath(cwd)
gemini_matlab = getenv("MATGEMINI");
if isempty(gemini_matlab)
gemini_matlab = fullfile(cwd, "../mat_gemini");
end
setup_file = fullfile(gemini_matlab, "setup.m");
if ~isfile(setup_file)
meta = jsondecode(fileread(fullfile(cwd, "libraries.json")));
cmd = "git -C " + fullfile(cwd, "..") + " clone --recurse-submodules " + meta.matgemini.git;
ret = system(cmd);
if ret == 0 && isfield(meta.matgemini, "tag") && ~isempty(meta.matgemini.tag)
ret = system("git -C " + gemini_matlab + " checkout " + meta.matgemini.tag);
end
assert(ret==0, "Failed to download MatGemini")
end
run(setup_file)
end