MCPcopy Create free account
hub / github.com/Serverless-Devs/Serverless-Devs / init

Method init

src/command/init/manager.ts:35–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 }
34
35 async init() {
36 logger.write(`\n${emoji('🚀')} More applications: ${chalk.underline('https://registry.serverless-devs.com')}`);
37 this.template = this.options.project;
38 if (endsWith(this.options.project, '.git')) {
39 return await this.gitCloneProject();
40 }
41
42 if (!this.options.project && !this.options.uri) {
43 const applicationsTemplates = await this.getApplicationTemplates();
44 const answers: any = await inquirer.prompt(applicationsTemplates);
45 this.template = answers.template || answers.firstLevel;
46 logger.write(`\n${emoji('😋')} Create application command: [s init ${this.template}]\n`);
47 }
48 const { appPath } = await this.executeInit();
49 appPath && execDaemon('report.js', { type: EReportType.init, template: this.template });
50 }
51
52 private async getProjectName() {
53 if (this.options.dir) {

Callers 1

index.tsFile · 0.45

Calls 4

gitCloneProjectMethod · 0.95
executeInitMethod · 0.95
execDaemonFunction · 0.85

Tested by

no test coverage detected