-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstartup.m
41 lines (32 loc) · 1.16 KB
/
startup.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
function startup(varargin)
%% STARTUP - Script to run startup scripts of sub-packages
% Copyright 2020 The MathWorks, Inc.
% Don't run the startup file if executed from within a deployed function (CTF)
if ~isdeployed()
here = fileparts(mfilename('fullpath'));
iDisplayBanner('MathWorks interfaces for Google Cloud Platform products');
disp('Running package startup scripts');
listing = dir(here);
for n = 1:numel(listing)
listing(n).name
if listing(n).isdir
pspPattern = '^matlab-\S+';
pspPatternIndex = regexpi(listing(n).name, pspPattern);
if pspPatternIndex == 1
startupPath = [listing(n).name, filesep, 'Software', filesep, 'MATLAB'] %#ok<NOPRT>
if exist(fullfile(here, startupPath, 'startup.m'), 'file') == 2
disp(['Running: ', fullfile(here, startupPath, 'startup.m')]);
run(fullfile(here, startupPath, 'startup.m'))
else
disp(['No startup.m found for: ', listing(n).name]);
end
end
end
end
end % deployed
end
%% HELPER function to create a banner
function iDisplayBanner(appStr)
disp(appStr);
disp(repmat('-',1,numel(appStr)));
end