build: use double quotes
This commit is contained in:
8
.github/scripts/build.mjs
vendored
8
.github/scripts/build.mjs
vendored
@@ -55,7 +55,7 @@ for (const id of Object.keys(plugins)) {
|
|||||||
readme.path,
|
readme.path,
|
||||||
readme.content
|
readme.content
|
||||||
.replace(/(<!--header-->)[\s\S]*(<!--\/header-->)/g, `$1\n${header}\n$2`)
|
.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(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({ test, prod, ...step }) => ["```yaml", yaml.dump(step, {quotingType:'"', noCompatMode:true}), "```"].join("\n")).join("\n")}\n$2`)
|
||||||
.replace(/(<!--options-->)[\s\S]*(<!--\/options-->)/g, `$1\n${options}\n$2`),
|
.replace(/(<!--options-->)[\s\S]*(<!--\/options-->)/g, `$1\n${options}\n$2`),
|
||||||
)
|
)
|
||||||
console.log(`Generating source/plugins/${id}/README.md`)
|
console.log(`Generating source/plugins/${id}/README.md`)
|
||||||
@@ -75,18 +75,18 @@ for (const id of Object.keys(templates)) {
|
|||||||
readme.path,
|
readme.path,
|
||||||
readme.content
|
readme.content
|
||||||
.replace(/(<!--header-->)[\s\S]*(<!--\/header-->)/g, `$1\n${header}\n$2`)
|
.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(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({ test, prod, ...step }) => ["```yaml", yaml.dump(step, {quotingType:'"', noCompatMode:true}), "```"].join("\n")).join("\n")}\n$2`),
|
||||||
)
|
)
|
||||||
console.log(`Generating source/templates/${id}/README.md`)
|
console.log(`Generating source/templates/${id}/README.md`)
|
||||||
|
|
||||||
//Tests
|
//Tests
|
||||||
workflow.push(...examples.map(example => testcase(templates[id].name, "prod", example)).filter(t => t))
|
workflow.push(...examples.map(example => testcase(templates[id].name, "prod", example)).filter(t => t))
|
||||||
await fs.writeFile(tests.path, yaml.dump(examples.map(example => testcase(templates[id].name, "test", example)).filter(t => t)))
|
await fs.writeFile(tests.path, yaml.dump(examples.map(example => testcase(templates[id].name, "test", example)).filter(t => t), {quotingType:'"', noCompatMode:true}))
|
||||||
console.log(`Generating tests/templates/${id}.yml`)
|
console.log(`Generating tests/templates/${id}.yml`)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Example workflows
|
//Example workflows
|
||||||
await update({ source: paths.join(__metrics, ".github/scripts/files/examples.yml"), output: ".github/workflows/examples.yml", context: { steps: yaml.dump(workflow) } })
|
await update({ source: paths.join(__metrics, ".github/scripts/files/examples.yml"), output: ".github/workflows/examples.yml", context: { steps: yaml.dump(workflow, {quotingType:'"', noCompatMode:true}) } })
|
||||||
|
|
||||||
//Commit and push
|
//Commit and push
|
||||||
if (mode === "publish") {
|
if (mode === "publish") {
|
||||||
|
|||||||
Reference in New Issue
Block a user