Skip to content

Commit 4b25ec2

Browse files
feat: print rover --help in postinstall if rover is in PATH
1 parent a52d83d commit 4b25ec2

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

installers/npm/install.js

+11
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22

33
const { install } = require("./binary");
44
install();
5+
// this is duplicated in `src/command/install/mod.rs`
6+
// for the curl installer.
7+
8+
// use setTimeout so the message prints after the install happens.zzs
9+
setTimeout(
10+
() =>
11+
console.log(
12+
"You can check out our getting started guide at https://go.apollo.dev/r/start."
13+
),
14+
400
15+
);

installers/npm/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/command/install/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
use ansi_term::Colour::Cyan;
12
use camino::Utf8PathBuf;
23
use serde::Serialize;
34
use structopt::StructOpt;
45

56
use binstall::Installer;
67

8+
use crate::command::docs::shortlinks;
79
use crate::command::RoverStdout;
810
use crate::PKG_NAME;
911
use crate::{anyhow, Context, Result};
@@ -35,6 +37,7 @@ impl Install {
3537
if install_location.is_some() {
3638
let bin_dir_path = installer.get_bin_dir_path()?;
3739
eprintln!("{} was successfully installed. Great!", &binary_name);
40+
3841
if !cfg!(windows) {
3942
if let Some(path_var) = env::var_os("PATH") {
4043
if !path_var
@@ -52,6 +55,13 @@ impl Install {
5255
}
5356
}
5457
}
58+
59+
// this is duplicated in `installers/npm/install.js`
60+
// for the npm installer.
61+
eprintln!(
62+
"You can check out our getting started guide at {}.",
63+
Cyan.normal().paint(shortlinks::get_url_from_slug("start"))
64+
);
5565
} else {
5666
eprintln!("{} was not installed. To override the existing installation, you can pass the `--force` flag to the installer.", &binary_name);
5767
}

0 commit comments

Comments
 (0)