forked from BlackrockNeurotech/NPMK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NPMKverChecker.m
43 lines (40 loc) · 1.28 KB
/
NPMKverChecker.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
function NPMKverChecker()
% NPMKverChecker
%
% Checks to see if there is a newer version of NPMK is available for
% download.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use NPMKverChecker
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Kian Torab
% support@blackrockmicro.com
% Blackrock Microsystems
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Version History
%
% 1.0.0.0: September 13, 2017
% - Initial release.
%
% 1.0.1.0: September 13, 2017
% - Fixed a crash in case there is no Internet connection.
%
% 1.0.2.0: January 10, 2018
% - Added a clickable URL to the prompt.
%
gitHubURL = 'https://github.com/BlackrockMicrosystems/NPMK/releases/latest';
%% Check for the latest version fo NPMK
try
FIDv = fopen('Versions.txt');
verFile = fscanf(FIDv, '%s');
fclose(FIDv);
latestVersion = verFile(findstr('LATEST', verFile)+7:findstr('LATEST', verFile)+13);
gitHubPage = urlread(gitHubURL);
newVersionAvailable = findstr(latestVersion, gitHubPage);
if isempty(newVersionAvailable)
disp('A new version of NPMK may be available.');
fprintf('Please visit <a href="%s">GitHub NPMK Page</a> to get the latest version.\n', gitHubURL)
end
catch
end