()
| 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) { |
no test coverage detected