Skip to content

Commit

Permalink
Add telemetry postinstall message (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper authored Apr 26, 2021
1 parent 1f9d618 commit 3c8de05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
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

0 comments on commit 3c8de05

Please sign in to comment.