Ignore:
Timestamp:
01/06/20 11:58:06 (5 years ago)
Author:
bduin
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • prextra/prtools_export.m

    r133 r143  
    4343
    4444% get rid of prtools in the path
    45 r = which('fisherc');
    46 if ~isempty(r)
    47   rmpath(r);
     45prtools_path = which('fisherc');
     46if ~isempty(prtools_path)
     47  prtools_path = fileparts(prtools_path);
     48  rmpath(prtools_path);
    4849end
    4950
     
    7374addpath(fullfile(pwd,'prtools'))
    7475pver  = prtver;
    75 fprintf(1,'    Present PRTools version is %s\n',pver{1}.Version);
    76 pver_new = input(['    Give new version number: [' pver{1}.Version '] '],'s');
    77 if isempty(pver_new)
    78   pver_new = pver{1}.Version;
    79 end
    80 set_version_in_Contents(pver_new);
    81 % Commit version change
    82 if isunix
    83   s = unix(['svn ci ' fullfile('prtools','Contents.m')]);
    84 elseif ispc
    85   fprintf(1,'    Tortoise will pop up to commit change version number in Contents, find it and click OK 2x')
    86   s = dos(['TortoiseProc.exe /command:commit /path:' fullfile('prtools','Contents.m')]);
    87   fprintf(1,'\n');
    88   input('    Ready to continue?');
    89 else
    90   error(['svn commit not implemented for Mac'])
     76pver = pver{1}.Version;
     77fprintf(1,'    Present PRTools version is %s\n',pver);
     78pver_new = input(['    Give new version number: [' pver '] '],'s');
     79if ~isempty(pver_new)
     80  set_version_in_Contents(pver_new);
     81  pver = pver_new;
     82  % Commit version change
     83  if isunix
     84    s = unix(['svn ci ' fullfile('prtools','Contents.m')]);
     85  elseif ispc
     86    fprintf(1,'    Tortoise will pop up to commit change version number in Contents, find it and click OK 2x')
     87    s = dos(['TortoiseProc.exe /command:commit /path:' fullfile('prtools','Contents.m')]);
     88    fprintf(1,'\n');
     89    input('    Ready to continue?');
     90  else
     91    error(['svn commit not implemented for Mac'])
     92  end
    9193end
    9294 
     
    130132copyfile('Install_notes.txt',exporttemp,'f');
    131133copyfile('Release_notes.txt',exporttemp,'f');
    132 exppfiles = ['prtex' pver_new '.' today '.zip'];
    133 mfiles = ['prtools' pver_new '.' today '.zip'];
     134exppfiles = ['prtex' pver '.' today '.zip'];
     135mfiles = ['prtools' pver '.' today '.zip'];
    134136zip(exppfiles,{'prtools','License.txt','Install_notes.txt','Release_notes.txt'},exporttemp);
    135137zip(mfiles,[fullfile(prtmp,'prtools') '/*']);
     138
     139% Clean and reconstruct path
     140rmpath(fullfile(prtmp,'prtools'));
    136141rmdir(prtmp,'s');
     142if ~isempty(prtools_path)
     143  addpath(prtools_path);
     144end
    137145 
    138146if doit
     
    143151  mput(ftpsite,exppfiles);
    144152  rename(ftpsite,exppfiles,'prtools.zip');
    145   disp('export files have been stored on the website.')
    146   disp('Please check and adjust release notes and known problems on website')
     153  disp('    export files have been stored on the website.')
     154  disp('    Please check and adjust release notes and known problems on website')
    147155  close(ftpsite)
    148156 
     
    152160  if s
    153161    delete(exppfiles);
    154     disp(['export files have been backed-up in ' exportdir])
     162    disp(['    export files have been backed-up in ' exportdir])
    155163  else
    156164    disp(mess);
     
    159167  if s
    160168    delete(mfiles);
    161     disp(['m-files have been backed-up in ' exportdir])
     169    disp(['    m-files have been backed-up in ' exportdir])
    162170  else
    163171    disp(mess);
    164172  end
     173else
     174  fprintf(1,'    The zip-files have been created in exportdir.\n');
     175  fprintf(1,'    They have not been copied to the website!\n');
     176  fprintf(1,'    If needed, rerun with flag set.\n');
    165177end
    166178   
Note: See TracChangeset for help on using the changeset viewer.