Skip to content

Commit

Permalink
Merge pull request #1914 from scruffystuffs/Explicit-home-vars
Browse files Browse the repository at this point in the history
Display the cargo and rustup home paths
  • Loading branch information
kinnison committed Jul 1, 2019
2 parents 8fab4b4 + c1acc83 commit 0f695e0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/cli/self_update.rs
Expand Up @@ -74,6 +74,15 @@ Cargo's bin directory, located at:
{cargo_home_bin}
This can be modified with the CARGO_HOME environment variable.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
{rustup_home}
This can be modified with the RUSTUP_HOME environment variable.
",
$platform_msg,
r#"
Expand Down Expand Up @@ -538,6 +547,7 @@ fn do_msvc_check(_opts: &InstallOpts) -> Result<bool> {
fn pre_install_msg(no_modify_path: bool) -> Result<String> {
let cargo_home = utils::cargo_home()?;
let cargo_home_bin = cargo_home.join("bin");
let rustup_home = utils::rustup_home()?;

if !no_modify_path {
if cfg!(unix) {
Expand All @@ -562,18 +572,21 @@ fn pre_install_msg(no_modify_path: bool) -> Result<String> {
pre_install_msg_unix!(),
cargo_home_bin = cargo_home_bin.display(),
plural = plural,
rcfiles = rcfiles
rcfiles = rcfiles,
rustup_home = rustup_home.display(),
))
} else {
Ok(format!(
pre_install_msg_win!(),
cargo_home_bin = cargo_home_bin.display()
cargo_home_bin = cargo_home_bin.display(),
rustup_home = rustup_home.display(),
))
}
} else {
Ok(format!(
pre_install_msg_no_modify_path!(),
cargo_home_bin = cargo_home_bin.display()
cargo_home_bin = cargo_home_bin.display(),
rustup_home = rustup_home.display(),
))
}
}
Expand Down

0 comments on commit 0f695e0

Please sign in to comment.