mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-25 16:07:37 +00:00
Merge pull request #310 from nfischer/fix-gen-docs
fix(gen-docs): fix issue where docs are generated wrong
This commit is contained in:
commit
f224776ff7
@ -21,3 +21,5 @@ os:
|
||||
- osx
|
||||
script:
|
||||
- npm test
|
||||
- node scripts/generate-docs.js
|
||||
- git diff --quiet # make sure no files have changed
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
/* globals cd, echo, grep, sed */
|
||||
/* globals cat, cd, echo, grep, sed */
|
||||
require('../global');
|
||||
|
||||
echo('Appending docs to README.md');
|
||||
@ -16,7 +16,11 @@ docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) {
|
||||
|
||||
// Remove '//@'
|
||||
docs = docs.replace(/\/\/\@ ?/g, '');
|
||||
// Append docs to README
|
||||
sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md');
|
||||
|
||||
// Wipe out the old docs
|
||||
cat('README.md').replace(/## Command reference(.|\n)*/, '## Command reference').to('README.md');
|
||||
|
||||
// Append new docs to README
|
||||
sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md');
|
||||
|
||||
echo('All done.');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user