You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thumbsup/scripts/update-readme.js

12 lines
439 B
JavaScript

const fs = require('node:fs')
const child = require('node:child_process')
// get latest CLI help text
const output = child.execSync('node bin/thumbsup.js --help')
const codeblock = '```' + output + '```'
// update README file
const readme = fs.readFileSync('README.md', 'utf-8')
const updated = readme.replace(/<!--STARTCLI-->[\s\S]*?<!--ENDCLI-->/, `<!--STARTCLI-->\n${codeblock}\n<!--ENDCLI-->`)
fs.writeFileSync('README.md', updated)