shelljs/scripts/docs.js
2012-03-02 15:11:40 -05:00

16 lines
360 B
JavaScript
Executable File

#!/usr/bin/env node
require('../global');
echo('Appending docs to README.md');
cd(__dirname + '/..');
// Extract docs from shell.js
var docs = grep('//@', 'shell.js');
// Remove '//@'
docs = docs.replace(/\/\/\@ */g, '');
// Append docs to README
sed('-i', /# Commands reference(.|\n)*/, '# Commands reference\n\n' + docs, 'README.md');
echo('All done.');