mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Disable templates prompt
This commit is contained in:
parent
8109ef9bb2
commit
0609389b5a
@ -61,7 +61,7 @@ async function getTemplateQuestion() {
|
||||
* @param {string|null} template - The template the project should use
|
||||
* @returns Array of prompt question objects
|
||||
*/
|
||||
async function getPromptQuestions(projectName, template) {
|
||||
async function getPromptQuestions(projectName /*, template*/) {
|
||||
return [
|
||||
{
|
||||
type: 'input',
|
||||
@ -85,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-enable once we know where to list the official compatible templates
|
||||
// {
|
||||
// type: 'confirm',
|
||||
// name: 'useTemplate',
|
||||
// when: !template,
|
||||
// message:
|
||||
// 'Would you like to use a template? (Templates are Strapi configurations designed for a specific use case)',
|
||||
// },
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ const { resolve, join, basename } = require('path');
|
||||
const fse = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const inquirer = require('inquirer');
|
||||
const _ = require('lodash/fp');
|
||||
|
||||
// All directories that a template could need
|
||||
const TEMPLATE_CONTENT = ['api', 'components', 'config/functions/bootstrap.js', 'data'];
|
||||
@ -55,7 +56,8 @@ async function writeTemplateJson(rootPath) {
|
||||
*/
|
||||
async function templateConfigExists(rootPath) {
|
||||
const jsonConfig = await fse.pathExists(join(rootPath, 'template.json'));
|
||||
return Boolean(jsonConfig);
|
||||
const configExists = !_.isNil(jsonConfig);
|
||||
return configExists;
|
||||
}
|
||||
|
||||
module.exports = async function generateTemplate(directory) {
|
||||
|
||||
@ -30,7 +30,9 @@ module.exports = async function mergeTemplate(scope, rootPath) {
|
||||
let templatePath;
|
||||
let templateParentPath;
|
||||
let templatePackageInfo = {};
|
||||
const isLocalTemplate = ['./', '../'].some(filePrefix => scope.template.startsWith(filePrefix));
|
||||
const isLocalTemplate = ['./', '../', '/'].some(filePrefix =>
|
||||
scope.template.startsWith(filePrefix)
|
||||
);
|
||||
|
||||
if (isLocalTemplate) {
|
||||
// Template is a local directory
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user