Commit a9632431 authored by Jay Dubb's avatar Jay Dubb
Browse files

Fix setpaths('update') not working.

parent f26e4c1d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2,13 +2,14 @@ function cleanupSharedLibs()
submodules = parseGitSubmodulesFile();
for ii = 1:size(submodules,1)
    submodulepath   = submodules{ii,3};
    [~, submodulename] = fileparts(submodules{ii,1});    
    if ispathvalid_startup(submodulepath)
        if ispathvalid_startup([submodulepath, '.old/'])
            fprintf('Deleteing folder %s\n', [submodulepath, '.old/']);
            rmdir([submodulepath, '.old/'],'s')
        if ispathvalid_startup([submodulename, '.old/'])
            fprintf('Deleteing folder %s\n', [submodulename, '.old/']);
            rmdir([submodulename, '.old/'],'s')
        end
        fprintf('Moving %s  to  %s\n', submodulepath, [submodulepath, '.old']);
        copyfile([submodulepath, '/*'], [submodulepath, '.old/']);
        fprintf('Moving %s  to  %s\n', submodulepath, [submodulename, '.old']);
        copyFolderContents(submodulepath, [submodulename, '.old/']);
        fprintf('Removing contents of %s\n', submodulepath);
        removeFolderContents(submodulepath);
    end    
+5 −0
Original line number Diff line number Diff line
function copyFolderContents(pnamesrc, pnamedst)

copyfile([pnamesrc, '/*'], pnamedst);
copyfile([pnamesrc, '/*.*'], pnamedst);
copyfile([pnamesrc, '/.*'], pnamedst);
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ msg{ii} = sprintf('WARNING: Git failed to install the following libraries requir
for jj = 1:size(s,1)
    msg{ii} = sprintf('    %s\n', s{jj,1}); ii = ii+1;
end
msg{ii} = sprintf('\n'); ii = ii+1;
msg{ii} = sprintf('\n'); ii = ii+1; %#ok<SPRINTFN>
msg{ii} = sprintf('Git might not be installed on your computer. '); ii = ii+1;
msg{ii} = sprintf('These libraries can still be installed without git. Please provide a branch name (default: ''development'') '); ii = ii+1;
msg{ii} = sprintf('of the submodles branches to download that matches the branch of the parent repo (this application).');
+4 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ for ii = 1:size(submodules,1)
    [~, submodulename] = fileparts(url);
    filenameDownload = sprintf('./%s-%s', submodulename, branch);

    cleanup(filenameDownload);
    cleanup(filenameDownload, submodulepath);
    
    fprintf('Downloading %s/archive/refs/heads/%s.zip  to  %s\n', url, branch, [filenameDownload, '.zip']);
    urlwrite(sprintf('%s/archive/refs/heads/%s.zip', url, branch), [filenameDownload, '.zip']); %#ok<URLWR>
@@ -27,7 +27,8 @@ end


% ----------------------------------------------------------
function cleanup(filenameDownload)
function cleanup(filenameDownload, submodulepath)
removeFolderContents(submodulepath);
if ispathvalid_startup([filenameDownload, '.zip'])
    fprintf('Removing %s\n', [filenameDownload, '.zip']);
    try
@@ -55,5 +56,5 @@ if ispathvalid_startup([filenameDownload, '.zip'])
end
if ispathvalid_startup(filenameDownload)
    fprintf('Copying %s/*  to  %s\n', filenameDownload, submodulepath);
    copyfile([filenameDownload, '/*'], submodulepath);
    copyFolderContents(filenameDownload, submodulepath);
end
+3 −18
Original line number Diff line number Diff line
@@ -7,13 +7,7 @@ if ~ispathvalid_startup(subdir, 'dir')
    fprintf('Warning: folder %s doesn''t exist under %s\n', subdir, pwd);
    return;
end
if strcmp(subdir, '.')
    return
end
if strcmp(subdir, '..')
    return
end
if strcmp(subdir, '.git')
if subdir(1) == '.'
    return
end

@@ -21,21 +15,12 @@ end
subdirFullpath = filesepStandard_startup(subdir,'full');
f = dir([subdirFullpath, '*']);
for ii = 1:length(f)
    if strcmp(f(ii).name, '.')
        continue
    end
    if strcmp(f(ii).name, '..')
        continue
    end
    if strcmp(f(ii).name, '.git')
        continue
    end
    if strcmp(f(ii).name, '.numberfiles')
    if f(ii).name(1) == '.'
        continue
    end
    
    if ~f(ii).isdir
        files{end+1,1} = filesepStandard_startup(sprintf('%s%s%s', subdirFullpath, f(ii).name), 'nameonly');        
        files{end+1,1} = filesepStandard_startup(sprintf('%s%s%s', subdirFullpath, f(ii).name), 'nameonly');         %#ok<*AGROW>
    else
        files = [files; findAllFiles([subdirFullpath, f(ii).name])];
    end
Loading