1 | #!/usr/bin/env node
|
2 |
|
3 | require('../global');
|
4 |
|
5 | echo('Appending docs to README.md');
|
6 |
|
7 | cd(__dirname + '/..');
|
8 |
|
9 |
|
10 | var docs = grep('^//@', 'shell.js');
|
11 |
|
12 |
|
13 | docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) {
|
14 | var file = path.match('.js$') ? path : path+'.js';
|
15 | return grep('^//@', file);
|
16 | });
|
17 |
|
18 |
|
19 | docs = docs.replace(/\/\/\@ ?/g, '');
|
20 |
|
21 |
|
22 | ShellString(cat('README.md').replace(/## Command reference(.|\n)*\n## Team/, '## Command reference\n## Team')).to('README.md');
|
23 |
|
24 |
|
25 | sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md');
|
26 |
|
27 | echo('All done.');
|