fix(ci): update some parameters [skip ci]

This commit is contained in:
lowlighter
2022-01-15 08:53:52 -05:00
parent b46cc1fea0
commit f33fe2dc00
22 changed files with 93 additions and 72 deletions

View File

@@ -46,10 +46,11 @@ for (const step of ["config", "documentation"]) {
//Plugins
for (const id of Object.keys(plugins)) {
const {examples, options, readme, tests} = await plugin(id)
const {examples, options, readme, tests, header} = await plugin(id)
//Readme
await fs.writeFile(readme.path, readme.content
.replace(/(<!--header-->)[\s\S]*(<!--\/header-->)/g, `$1\n${header}\n$2`)
.replace(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({test, prod, ...step}) => ["```yaml", yaml.dump(step), "```"].join("\n")).join("\n")}\n$2`)
.replace(/(<!--options-->)[\s\S]*(<!--\/options-->)/g, `$1\n${options}\n$2`)
)
@@ -121,7 +122,8 @@ async function plugin(id) {
path:tests
},
examples:fss.existsSync(examples) ? yaml.load(await fs.readFile(examples), "utf8") ?? [] : [],
options:plugins[id].readme.table
options:plugins[id].readme.table,
header:plugins[id].readme.header
}
}