mirror of
https://github.com/strapi/strapi.git
synced 2025-07-19 07:02:26 +00:00
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
const execa = require('execa');
|
|
const chalk = require('chalk');
|
|
|
|
const { trackUsage } = require('./utils/usage');
|
|
const defaultConfigs = require('./utils/db-configs.js');
|
|
const clientDependencies = require('./utils/db-client-dependencies.js');
|
|
const createProject = require('./create-project');
|
|
|
|
module.exports = async function createQuickStartProject(scope) {
|
|
console.log('Creating a quickstart project.');
|
|
await trackUsage({ event: 'didChooseQuickstart', scope });
|
|
|
|
// get default sqlite config
|
|
const client = 'sqlite';
|
|
const configuration = {
|
|
client,
|
|
connection: defaultConfigs[client],
|
|
dependencies: clientDependencies({ scope, client }),
|
|
};
|
|
|
|
await createProject(scope, configuration);
|
|
|
|
if (scope.runQuickstartApp === true) {
|
|
console.log(
|
|
`Running your Strapi application at ${chalk.green(scope.rootPath)}`
|
|
);
|
|
|
|
await execa('npm', ['run', 'develop'], {
|
|
stdio: 'inherit',
|
|
cwd: scope.rootPath,
|
|
env: {
|
|
FORCE_COLOR: 1,
|
|
},
|
|
}).catch(() => {});
|
|
}
|
|
};
|