add template replace option
Signed-off-by: pitwegner <pit.wegner@gmail.com> Signed-off-by: pitwegner <pit.wegner@student.hpi.de>
This commit is contained in:
@@ -118,6 +118,12 @@ export function createFetchTemplateAction(options: {
|
||||
'If set, only files with the given extension will be templated. If set to `true`, the default extension `.njk` is used.',
|
||||
type: ['string', 'boolean'],
|
||||
},
|
||||
replace: {
|
||||
title: 'Replace files',
|
||||
description:
|
||||
'If set, replace files in targetPath instead of skipping existing ones.',
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -261,7 +267,7 @@ export function createFetchTemplateAction(options: {
|
||||
}
|
||||
|
||||
const outputPath = resolveSafeChildPath(outputDir, localOutputPath);
|
||||
if (fs.existsSync(outputPath)) {
|
||||
if (fs.existsSync(outputPath) && !ctx.input.replace) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user