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

v1.31.11

-- Fix bug in setpaths introduced last commit for AV-Homer3 coexistence changes
-- Better version of findDotMFiles.m which does not change folders
-- Better version of isalnum.m which does some error checking
parent b2feae28
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
function dotmfiles = findDotMFiles(subdir, exclList)

if ~exist('subdir','var')
    subdir = filesepStandard(pwd);
end
if ~exist('exclList','var')
    exclList = {};
end

if ~iscell(exclList)
    exclList = {exclList};
end

dotmfiles = {};
currdir = pwd;

if exist(subdir, 'dir')~=7
if ~ispathvalid(subdir, 'dir')
    fprintf('Warning: folder %s doesn''t exist under %s\n', subdir, pwd);
    return;
end
cd(subdir);


% If current subjdir is in the exclList then go back to curr dir and exit
subdirFullpath = pwd;
subdirFullpath = filesepStandard(fullpath(subdir));

for ii=1:length(exclList)
    if ~isempty(findstr(exclList{ii}, subdirFullpath))
        cd(currdir);
        return;
    end
end

files = dir('*');
files = dir([subdirFullpath, '*']);
if isempty(files)
    return;
end
@@ -39,12 +44,11 @@ for ii=1:length(files)
        if exclFlag==true
            continue;
        end
        dotmfiles{end+1} = filesepStandard(sprintf('%s%s%s', pwd, filesep, files(ii).name), 'nameonly');
        dotmfiles{end+1,1} = filesepStandard(sprintf('%s%s%s', subdirFullpath, files(ii).name), 'nameonly');
    elseif files(ii).isdir && ~iscurrdir(files(ii)) && ~isparentdir(files(ii))
        dotmfiles = [dotmfiles, findDotMFiles(files(ii).name, exclList)];
        dotmfiles = [dotmfiles; findDotMFiles([subdirFullpath, files(ii).name], exclList)];
    end
end
cd(currdir);



+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '31';  % Major sub-version #
vrnnum{3} = '10';   % Minor version #
vrnnum{3} = '11';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc
+4 −1
Original line number Diff line number Diff line
function y = isalnum( x )

y = false;
if isempty(x)
    return;
end
y = all( (x>='0' & x<='9') | (x>='a' & x<='z') | (x>='A' & x<='Z') );
+13 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ if options.conflcheck
    % appmainfunc = {'Homer2_UI.m','Homer3.m','AtlasViewerGUI.m','brainScape.m'};
    % Remove AtlasViewer from list of conflicting workspaces needed to be removed
    % in preparation for coexistance in one matlab session
    appmainfunc = {'Homer2_UI.m','Homer3.m','brainScape.m'};
    appmainfunc = {'Homer2_UI.m','Homer3.m','brainScape.m','ResolveCommonFunctions.m'};
        
    kk=1;
    wsidx = [];
@@ -67,7 +67,7 @@ if options.conflcheck
                    paths_excl_str{kk} = [paths_excl_str{kk}, delimiter, paths_excl{jj}];
                end
            end
            rmpath(paths_excl_str{kk});
            removePaths(paths_excl_str{kk}, wspaths{1,1});
            kk=kk+1;
            
        end
@@ -90,3 +90,14 @@ if options.conflcheck
    
end




% ---------------------------------------------------------------
function removePaths(paths, wspace)

rmpath(paths);
if exist([pwd, '/Utils'], 'dir')==7
    addpath([pwd, '/Utils'], '-end');
end