Skip to content
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

revert(cli): add analytics opt out message #3600

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions apps/wing/src/analytics/disclaimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,10 @@ For more information see ${chalk.blueBright.bold.underline("https://winglang.io/
${chalk.redBright("(This message will self-destruct after the first run)")}
`;

export const WING_OPT_OUT_CONFIRMATION = `
🙈 Wing analytics are disabled, no data will be collected this run. 🙈
`;

function displayDisclaimer() {
console.log(`${chalk.hex("#2AD5C1")(WING_DISCLAIMER)}`);
}

export function displayOptOutConfirmation() {
console.log(`${chalk.hex("#2AD5C1")(WING_OPT_OUT_CONFIRMATION)}`);
}

export function shouldDisplayDisclaimer(config: AnalyticsConfig): boolean {
// only consider display if stdin is a TTY
if (!process.stdin.isTTY) {
Expand Down
3 changes: 1 addition & 2 deletions apps/wing/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Command, Option } from "commander";

import { collectCommandAnalytics } from "./analytics/collect";
import { exportAnalytics } from "./analytics/export";
import { displayOptOutConfirmation, optionallyDisplayDisclaimer } from "./analytics/disclaimer";
import { optionallyDisplayDisclaimer } from "./analytics/disclaimer";
import { currentPackage } from "./util";

export const PACKAGE_VERSION = currentPackage.version;
Expand Down Expand Up @@ -39,7 +39,6 @@ function runSubCommand(subCommand: string) {

async function collectAnalyticsHook(cmd: Command) {
if (process.env.WING_DISABLE_ANALYTICS) {
if (PACKAGE_VERSION !== "0.0.0") { displayOptOutConfirmation(); }
return;
}
// Fail silently if collection fails
Expand Down
4 changes: 0 additions & 4 deletions docs/docs/09-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ If you would like to opt out of the analytics gathering, then you can do so by s
wing compile -t sim app.w --no-analytics
```

For piece of mind, the Wing cli will output a friendly confirmation message when you opt out of analytics collection.

![Wing analytics opt out confirmation](./analytics-opt-out.png)

### What data is collected

Each run of the Wing cli collects information about various aspects of the environment it is running in. Below are the analytics we gather. As well
Expand Down
Binary file removed docs/docs/analytics-opt-out.png
Binary file not shown.
Loading