mirror of
https://github.com/strapi/strapi.git
synced 2025-10-17 02:53:22 +00:00
chore: disable --templates while we rework them
This commit is contained in:
parent
e7ee24229e
commit
bc6069db81
@ -39,7 +39,7 @@ command
|
||||
.option('--dbfile <dbfile>', 'Database file path for sqlite')
|
||||
|
||||
// templates
|
||||
.option('--template <templateurl>', 'Specify a Strapi template')
|
||||
// .option('--template <templateurl>', 'Specify a Strapi template')
|
||||
.description('create a new application')
|
||||
.action((directory, options) => {
|
||||
createStrapiApp(directory, options);
|
||||
@ -60,7 +60,7 @@ async function createStrapiApp(directory: string | undefined, options: Options)
|
||||
directory: appDirectory,
|
||||
useTypescript: true,
|
||||
packageManager: 'npm',
|
||||
template: options.template,
|
||||
// template: options.template,
|
||||
isQuickstart: options.quickstart,
|
||||
} as GenerateNewAppOptions;
|
||||
|
||||
@ -101,16 +101,16 @@ async function createStrapiApp(directory: string | undefined, options: Options)
|
||||
}
|
||||
|
||||
async function validateOptions(options: Options) {
|
||||
const programFlags = command
|
||||
.createHelp()
|
||||
.visibleOptions(command)
|
||||
.reduce<Array<string | undefined>>((acc, { short, long }) => [...acc, short, long], [])
|
||||
.filter(Boolean);
|
||||
// const programFlags = command
|
||||
// .createHelp()
|
||||
// .visibleOptions(command)
|
||||
// .reduce<Array<string | undefined>>((acc, { short, long }) => [...acc, short, long], [])
|
||||
// .filter(Boolean);
|
||||
|
||||
if (options.template && programFlags.includes(options.template)) {
|
||||
console.error(`${options.template} is not a valid template`);
|
||||
process.exit(1);
|
||||
}
|
||||
// if (options.template && programFlags.includes(options.template)) {
|
||||
// console.error(`${options.template} is not a valid template`);
|
||||
// process.exit(1);
|
||||
// }
|
||||
|
||||
if (options.javascript === true && options.typescript === true) {
|
||||
console.error('You cannot use both --typescript (--ts) and --javascript (--js) flags together');
|
||||
|
@ -12,7 +12,7 @@ export interface Options {
|
||||
dbpassword?: string;
|
||||
dbssl?: string;
|
||||
dbfile?: string;
|
||||
template?: string;
|
||||
// template?: string;
|
||||
typescript?: boolean;
|
||||
javascript?: boolean;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import execa from 'execa';
|
||||
|
||||
import stopProcess from './utils/stop-process';
|
||||
import { trackUsage } from './utils/usage';
|
||||
import mergeTemplate from './utils/merge-template.js';
|
||||
// import mergeTemplate from './utils/merge-template.js';
|
||||
import tryGitInit from './utils/git';
|
||||
|
||||
import createPackageJSON from './resources/json/common/package.json';
|
||||
@ -92,18 +92,18 @@ export default async function createProject(scope: Scope) {
|
||||
await trackUsage({ event: 'didCopyConfigurationFiles', scope });
|
||||
|
||||
// merge template files if a template is specified
|
||||
const hasTemplate = Boolean(scope.template);
|
||||
if (hasTemplate) {
|
||||
try {
|
||||
await mergeTemplate(scope, rootPath);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(`⛔️ Template installation failed: ${error.message}`);
|
||||
}
|
||||
// const hasTemplate = Boolean(scope.template);
|
||||
// if (hasTemplate) {
|
||||
// try {
|
||||
// await mergeTemplate(scope, rootPath);
|
||||
// } catch (error) {
|
||||
// if (error instanceof Error) {
|
||||
// throw new Error(`⛔️ Template installation failed: ${error.message}`);
|
||||
// }
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
// throw error;
|
||||
// }
|
||||
// }
|
||||
} catch (err) {
|
||||
await fse.remove(scope.rootPath);
|
||||
throw err;
|
||||
|
@ -37,7 +37,6 @@ export const generateNewApp = async (options: Options) => {
|
||||
template: options.template,
|
||||
packageJsonStrapi: {
|
||||
template: options.template,
|
||||
starter: options.starter,
|
||||
},
|
||||
uuid: (process.env.STRAPI_UUID_PREFIX || '') + crypto.randomUUID(),
|
||||
docker: process.env.DOCKER === 'true',
|
||||
|
@ -27,7 +27,6 @@ export interface Options {
|
||||
|
||||
runApp?: boolean;
|
||||
template?: string;
|
||||
starter?: string;
|
||||
|
||||
isQuickstart?: boolean;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user