0001 function pre_release(rname, outdir, proj, proj_descrip, proj_url)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if nargin < 1
0018 rname = '';
0019 end
0020 if isempty(rname)
0021 rname = '-%s';
0022 end
0023 if nargin < 2
0024 outdir = '';
0025 end
0026 if isempty(outdir)
0027 outdir = pwd;
0028 end
0029 if nargin < 3
0030 proj = 'marsbar';
0031 end
0032 if nargin < 4
0033 proj_descrip = 'MarsBaR ROI toolbox';
0034 end
0035 if nargin < 5
0036 proj_url = 'git://github.com/marsbar-toolbox/marsbar.git';
0037 end
0038
0039
0040 V = eval([proj '(''ver'')']);
0041 rname = sprintf(rname, V);
0042
0043
0044 cmd = sprintf('git clone %s %s', proj_url, proj);
0045 unix(cmd);
0046
0047
0048 contents_str = sprintf('Contents of %s version %s', proj_descrip, V);
0049 make_contents(contents_str, 'fncrd', fullfile(pwd, proj, proj));
0050
0051
0052 full_name = sprintf('%s%s', proj, rname);
0053 unix(sprintf('mv %s/%s %s', proj, proj, full_name));
0054
0055 unix(sprintf('tar zcvf %s.tar.gz %s', full_name, full_name));
0056 unix(sprintf('zip -r %s.zip %s', full_name, full_name));
0057
0058 unix(sprintf('rm -rf %s', full_name));
0059 unix(sprintf('rm -rf %s', proj));
0060
0061 fprintf('Created %s release %s\n', proj, full_name);
0062 fprintf('Consider Changelog, e.g git log --pretty=%%s --first-parent\n');