diff --git a/src/TemplatesCommand.js b/src/TemplatesCommand.js index 699fb3cd..b7059d09 100644 --- a/src/TemplatesCommand.js +++ b/src/TemplatesCommand.js @@ -150,6 +150,14 @@ class TemplatesCommand extends AddCommand { } = {}) { const spinner = ora() + if (templates.length <= 0) { + aioLogger.debug('installTemplates: standalone-app') + await this.config.runHook('telemetry', { data: 'installTemplates:standalone-app' }) + } else { + aioLogger.debug(`installTemplates: ${templates}`) + await this.config.runHook('telemetry', { data: `installTemplates:${templates}` }) + } + // install the templates in sequence for (const template of templates) { spinner.info(`Installing template ${template}`) diff --git a/test/TemplatesCommand.test.js b/test/TemplatesCommand.test.js index 4a7c4dbc..8b7645ed 100644 --- a/test/TemplatesCommand.test.js +++ b/test/TemplatesCommand.test.js @@ -96,7 +96,8 @@ let command beforeEach(() => { command = new TheCommand() command.config = { - runCommand: jest.fn() + runCommand: jest.fn(), + runHook: jest.fn() } inquirer.registerPrompt.mockReset()