Re-enable templates

This commit is contained in:
Rémi de Juvigny 2021-09-24 14:49:41 +02:00
parent e3418695b6
commit 4fef307c46
2 changed files with 10 additions and 22 deletions

View File

@ -57,11 +57,12 @@ async function getTemplateQuestion() {
}
/**
*
* @param {string|null} projectName - The name of the project
* @param {string|null} template - The template the project should use
* @returns Array of prompt question objects
*/
// TODO: re-enabled once the template have been migrated to V4
async function getPromptQuestions(projectName /*, template */) {
async function getPromptQuestions(projectName, template) {
return [
{
type: 'input',
@ -85,14 +86,13 @@ async function getPromptQuestions(projectName /*, template */) {
},
],
},
// TODO: re-enabled once the template have been migrated to V4
// {
// type: 'confirm',
// name: 'useTemplate',
// when: !template,
// message:
// 'Would you like to use a template? (Templates are Strapi configurations designed for a specific use case)',
// },
{
type: 'confirm',
name: 'useTemplate',
when: !template,
message:
'Would you like to use a template? (Templates are Strapi configurations designed for a specific use case)',
},
];
}

View File

@ -18,19 +18,7 @@ sentry.init({
dsn: 'https://841d2b2c9b4d4b43a4cde92794cb705a@sentry.io/1762059',
});
// TODO: to remove after the templates are updated for V4
const warnTemplatesAreDisabled = cliArguments => {
if (cliArguments.template) {
console.log(
'❌ Templates have been disabled for the Beta version of V4 and will be re-enabled soon!'
);
process.exit();
}
};
module.exports = (projectDirectory, cliArguments) => {
warnTemplatesAreDisabled(cliArguments);
checkRequirements();
const rootPath = resolve(projectDirectory);