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

Add telemetry postinstall message #456

Merged
merged 3 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 11 additions & 9 deletions installers/npm/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

const { install } = require("./binary");
install();
// this is duplicated in `src/command/install/mod.rs`
// for the curl installer.

// use setTimeout so the message prints after the install happens.zzs
setTimeout(
() =>
console.log(
"You can check out our documentation at https://go.apollo.dev/r/docs."
),
400
);
setTimeout(() => {
// these messages are duplicated in `src/command/install/mod.rs`
// for the curl installer.
console.log(
"If you would like to disable Rover's anonymized usage collection, you can set APOLLO_TELEMETRY_DISABLED=1"
);
console.log(
"You can check out our documentation at https://go.apollo.dev/r/docs."
),
400;
});
7 changes: 5 additions & 2 deletions src/command/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use structopt::StructOpt;

use binstall::Installer;

use crate::command::docs::shortlinks;
use crate::command::RoverStdout;
use crate::PKG_NAME;
use crate::{anyhow, Context, Result};
use crate::{command::docs::shortlinks, utils::env::RoverEnvKey};

use std::convert::TryFrom;
use std::env;
Expand Down Expand Up @@ -56,8 +56,11 @@ impl Install {
}
}

// this is duplicated in `installers/npm/install.js`
// these messages are duplicated in `installers/npm/install.js`
// for the npm installer.
eprintln!(
"If you would like to disable Rover's anonymized usage collection, you can set {}=1", RoverEnvKey::TelemetryDisabled
);
eprintln!(
"You can check out our documentation at {}.",
Cyan.normal().paint(shortlinks::get_url_from_slug("docs"))
Expand Down