Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Opt-in to tracking by default on GitPod
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed May 5, 2020
1 parent b262f01 commit f42af45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/eventtracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const track = async (eventType, eventProperties) => {
rl.question(
chalk`We would like to collect data on near-shell usage to improve developer experience.` +
chalk ` We will never send private information. We only collect which commands are run via an anonymous identifier.` +
chalk`{bold.yellow Would you like to opt in (y/n)?}`,
chalk`{bold.yellow Would you like to opt in (y/n)? }`,
async (consentToEventTracking) => {
if (consentToEventTracking == 'y' || consentToEventTracking == 'Y') {
resolve(true);
Expand All @@ -41,8 +41,9 @@ const track = async (eventType, eventProperties) => {
}
return false; // If they can't figure it out in this many attempts, just opt out
};

shellSettings[TRACKING_ENABLED_KEY] = await getEventTrackingConsent();

const isGitPod = !!process.env.GITPOD_WORKSPACE_URL;
shellSettings[TRACKING_ENABLED_KEY] = isGitPod ? true : await getEventTrackingConsent();
shellSettings[TRACKING_SESSION_ID_KEY] = shellSettings[TRACKING_ENABLED_KEY] ? uuid.v4() : undefined;
rl.close();
settings.saveShellSettings(shellSettings);
Expand Down

0 comments on commit f42af45

Please sign in to comment.