mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
run-tests.js previously relied on shell wildcard expansion, and did not specify full paths. This uses common.expand to handle globbing internally, and specifies the full path, so jshint can find all the files.
23 lines
548 B
JavaScript
Executable File
23 lines
548 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
/* globals cd, echo, grep, sed */
|
|
require('../global');
|
|
|
|
echo('Appending docs to README.md');
|
|
|
|
cd(__dirname + '/..');
|
|
|
|
// Extract docs from shell.js
|
|
var docs = grep('//@', 'shell.js');
|
|
|
|
docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) {
|
|
var file = path.match('.js$') ? path : path+'.js';
|
|
return grep('//@', file);
|
|
});
|
|
|
|
// Remove '//@'
|
|
docs = docs.replace(/\/\/\@ ?/g, '');
|
|
// Append docs to README
|
|
sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md');
|
|
|
|
echo('All done.');
|