Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 50714b4 commit 3de5e5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/commands/readme.ts
Expand Up @@ -12,7 +12,13 @@ const normalize = require('normalize-package-data')
const requireResolve = require('require-resolve')

export default class Readme extends Command {
static description = 'adds commands to readme'
static description = `adds commands to README.md in current directory
The readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:
<!-- install -->
<!-- usage -->
<!-- commands -->
`
static flags = {
multi: flags.boolean({description: 'create a different markdown page for each topic'})
}
Expand Down Expand Up @@ -49,8 +55,7 @@ export default class Readme extends Command {
if (readme.includes(`<!-- ${tag}stop -->`)) {
readme = readme.replace(new RegExp(`<!-- ${tag} -->(.|\n)*<!-- ${tag}stop -->`, 'm'), `<!-- ${tag} -->`)
}
} else {
readme += `\n<!-- ${tag} -->`
this.log(`replacing <!-- ${tag} --> in README.md`)
}
return readme.replace(`<!-- ${tag} -->`, `<!-- ${tag} -->\n${body}\n<!-- ${tag}stop -->`)
}
Expand Down

0 comments on commit 3de5e5e

Please sign in to comment.