Merge pull request #11043 from strapi/v4/disable-template

Disable templates for the moment
This commit is contained in:
Alexandre BODIN 2021-09-23 17:42:07 +02:00 committed by GitHub
commit 88bff3cb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View File

@ -60,7 +60,8 @@ async function getTemplateQuestion() {
*
* @returns Array of prompt question objects
*/
async function getPromptQuestions(projectName, template) {
// TODO: re-enabled once the template have been migrated to V4
async function getPromptQuestions(projectName /*, template */) {
return [
{
type: 'input',
@ -84,13 +85,14 @@ async function getPromptQuestions(projectName, template) {
},
],
},
{
type: 'confirm',
name: 'useTemplate',
when: !template,
message:
'Would you like to use a template? (Templates are Strapi configurations designed for a specific use case)',
},
// 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)',
// },
];
}

View File

@ -18,7 +18,19 @@ 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);