Skip to content

chore: fix the template name that will be send to google analytics #3725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2018

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jul 3, 2018

Fix data send to google analytics when tns create --template <localTemplatePath> command is executed.
Expected: localTemplate_tns-template-hello-world
Current: localTemplate_livesync-hello-world.tgz

PR Checklist

What is the current behavior?

tns create myApp --template <localTemplatePath> sends wrong data to google analytics

What is the new behavior?

tns create myApp --template <localTemplatePath> sends correct data to google analytics

@Fatme Fatme changed the title Fix the template template that will be send to google analytics Fix the template name that will be send to google analytics Jul 3, 2018
@Fatme Fatme changed the title Fix the template name that will be send to google analytics chore: fix the template name that will be send to google analytics Jul 3, 2018
@@ -92,7 +92,7 @@ export class ProjectTemplatesService implements IProjectTemplatesService {
private getTemplateNameToBeTracked(templateName: string, packageJsonContent: any): string {
try {
if (this.$fs.exists(templateName)) {
const templateNameToBeTracked = this.$fs.exists(path.join(templateName, constants.PACKAGE_JSON_FILE_NAME)) ? packageJsonContent.name : path.basename(templateName);
const templateNameToBeTracked = packageJsonContent && packageJsonContent.name ? packageJsonContent.name : path.basename(templateName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be shorten:

const templateNameToBeTracked = (packageJsonContent && packageJsonContent.name) || path.basename(templateName);

But I do not insist changing it.

@Fatme Fatme force-pushed the fatme/fix-tracked-template-name branch from 5694c83 to 44bb8ca Compare July 4, 2018 05:36
@Fatme Fatme merged commit 524ff68 into master Jul 4, 2018
@Fatme Fatme deleted the fatme/fix-tracked-template-name branch July 4, 2018 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants