From 8d5c564931be5ee3db7495104fbfe0a5a9cb61d9 Mon Sep 17 00:00:00 2001 From: Igor Ribeiro Date: Tue, 7 Jun 2022 13:56:18 -0700 Subject: [PATCH] Writting the data option chosen by the user (#709) * Writting the data option chosen by the user * Moving constructor back to original --- src/app/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/index.ts b/src/app/index.ts index 0bcbfcb9..cbdcb95c 100755 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -116,7 +116,6 @@ module.exports = class extends yo { /* Prompt user for project options */ async prompting(): Promise { - usageDataObject = new usageData.OfficeAddinUsageData(usageDataOptions); try { const promptForUsageData = [ { @@ -230,6 +229,8 @@ module.exports = class extends yo { const endForHost = (new Date()).getTime(); const durationForHost = (endForHost - startForHost) / 1000; + usageDataObject = new usageData.OfficeAddinUsageData(usageDataOptions); + /* Configure project properties based on user input or answers to prompts */ this._configureProject(answerForProjectType, answerForScriptType, answerForHost, answerForName, isManifestProject, isExcelFunctionsProject); const projectInfo = { @@ -242,6 +243,7 @@ module.exports = class extends yo { // Send usage data for project created usageDataObject.reportEvent(defaults.promptSelectionstEventName, projectInfo); } catch (err) { + usageDataObject = new usageData.OfficeAddinUsageData(usageDataOptions); usageDataObject.reportError(defaults.promptSelectionsErrorEventName, new Error('Prompting Error: ' + err)); } }