feat: update create challenge and challenge generator

This commit is contained in:
thomas
2024-05-27 21:38:48 +02:00
parent c8ba057fe0
commit 9bef9dbd90
3 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
{
"name": "<%= authorName %>"
}

View File

@@ -81,6 +81,21 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
category: options.category,
});
const authorFile = tree.read(
`./docs/src/content/authors/${options.author}.json`,
);
if (!authorFile) {
generateFiles(
tree,
join(__dirname, 'files', 'author'),
`./docs/src/content/authors/`,
{
tmpl: '',
authorName: options.author,
},
);
}
generateFiles(
tree,
join(__dirname, 'files', 'docs'),