0001 function checkVersion()
0002
0003
0004
0005
0006 dsGetRootPath = fullfile(thisMfileDir(), '..');
0007 vFile = fullfile(dsGetRootPath, '.ds_version');
0008 keyboard
0009 if exist(vFile, 'file')
0010 fid = fopen(vFile, 'r');
0011 currentSHA = textscan(fid,'%s');
0012 currentSHA = currentSHA{1}{1};
0013 fclose(fid);
0014 else
0015 currentSHA = [];
0016 end
0017 fid = fopen(vFile, 'w');
0018
0019
0020
0021 request = matlab.net.http.RequestMessage;
0022 uri = 'https://api.github.com/repos/DynaSim/DynaSim/commits';
0023 response = send(request, uri);
0024 githubSHA = response.Body.Data(1).sha;
0025
0026
0027 if ~strcmp(currentSHA, githubSHA)
0028 fprintf('\nWarning: Your version of dynasim is outdated. Please update from github.\n')
0029 end
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 fclose(fid);