Skip to content

Commit

Permalink
fix(cli): don't show analytics message when telemetry is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jun 4, 2020
1 parent 2a8b748 commit 642cfe8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions garden-service/src/analytics/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ export class AnalyticsHandler {

const gitHubUrl = getGitHubUrl("README.md#Analytics")
if (this.analyticsConfig.firstRun || this.analyticsConfig.showOptInMessage) {
if (!this.isCI) {
const analyticsEnabled = this.analyticsEnabled()

if (!this.isCI && analyticsEnabled) {
const msg = dedent`
Thanks for installing Garden! We work hard to provide you with the best experience we can. We collect some anonymized usage data while you use Garden. If you'd like to know more about what we collect or if you'd like to opt out of telemetry, please read more at ${gitHubUrl}
`
Expand All @@ -219,7 +221,7 @@ export class AnalyticsHandler {

await this.globalConfigStore.set([globalConfigKeys.analytics], this.analyticsConfig)

if (this.segment && this.analyticsEnabled()) {
if (this.segment && analyticsEnabled) {
this.segment.identify({
userId: getUserId({ analytics: this.analyticsConfig }),
traits: {
Expand Down

0 comments on commit 642cfe8

Please sign in to comment.