1
1
mirror of https://github.com/primer/css.git synced 2024-11-29 06:02:33 +03:00

Delete generate-bundle-readmes

This commit is contained in:
Jon Rohan 2021-03-29 23:00:23 -07:00
parent 5aa2a95df2
commit 34129eafb2
No known key found for this signature in database
GPG Key ID: B0BBE304A9A0AECB

View File

@ -1,21 +0,0 @@
#!/usr/bin/env node
const {dirname, join} = require('path')
const globby = require('globby')
const {exists, readFile, writeFile} = require('fs-extra')
Promise.all([
readFile('src/README.template.md', 'utf8'),
globby('src/*/index.scss')
]).then(async ([template, indexes]) => {
for (const indexPath of indexes) {
const dir = dirname(indexPath)
const parts = dir.split('/')
const bundle = parts.pop()
const readmePath = join(dir, 'README.md')
await writeFile(readmePath, getReadmeContents(bundle), 'utf8')
}
function getReadmeContents(bundle) {
return template.replace(/{bundle}/g, bundle)
}
})