mirror of
https://github.com/strapi/strapi.git
synced 2025-11-16 10:07:55 +00:00
Merge pull request #14128 from WalkingPizza/fix/14114
Throw if --template flag is immediately followed by another flag when creating app via CLI
This commit is contained in:
commit
d90504462c
@ -62,6 +62,15 @@ async function initProject(projectName, program) {
|
|||||||
await checkInstallPath(resolve(projectName));
|
await checkInstallPath(resolve(projectName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const programFlags = program.options
|
||||||
|
.reduce((acc, { short, long }) => [...acc, short, long], [])
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
|
if (program.template && programFlags.includes(program.template)) {
|
||||||
|
console.error(`${program.template} is not a valid template`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
const hasDatabaseOptions = databaseOptions.some((opt) => program[opt]);
|
const hasDatabaseOptions = databaseOptions.some((opt) => program[opt]);
|
||||||
|
|
||||||
if (program.quickstart && hasDatabaseOptions) {
|
if (program.quickstart && hasDatabaseOptions) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user