Skip to content

Commit e488c77

Browse files
committed
Clarify help message with the Cargo home directory
Before this PR, the help message is: ``` Cargo's bin directory, located at: {cargo_home_bin} This can be modified with the CARGO_HOME environment variable. ``` above **WILL** potentially mislead the user to set `CARGO_HOME` to `{cargo_home_bin}`, which is wrong. This PR clearify the concept of `the Cargo home directory`, to separate from `Cargo's bin directory`, in fact, it's 2 different concepts and folders.
1 parent c022b92 commit e488c77

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/cli/self_update.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,24 @@ macro_rules! pre_install_msg_template {
7474
This will download and install the official compiler for the Rust
7575
programming language, and its package manager, Cargo.
7676
77-
It will add the `cargo`, `rustc`, `rustup` and other commands to
78-
Cargo's bin directory, located at:
79-
80-
{cargo_home_bin}
81-
82-
This can be modified with the CARGO_HOME environment variable.
83-
8477
Rustup metadata and toolchains will be installed into the Rustup
8578
home directory, located at:
8679
8780
{rustup_home}
8881
8982
This can be modified with the RUSTUP_HOME environment variable.
9083
84+
The Cargo home directory located at:
85+
86+
{cargo_home}
87+
88+
This can be modified with the CARGO_HOME environment variable.
89+
90+
The `cargo`, `rustc`, `rustup` and other commands will be added to
91+
Cargo's bin directory, located at:
92+
93+
{cargo_home_bin}
94+
9195
",
9296
$platform_msg,
9397
r#"
@@ -562,6 +566,7 @@ fn pre_install_msg(no_modify_path: bool) -> Result<String> {
562566
let rcfiles = rcfiles.join("\n");
563567
Ok(format!(
564568
pre_install_msg_unix!(),
569+
cargo_home = cargo_home.display(),
565570
cargo_home_bin = cargo_home_bin.display(),
566571
plural = plural,
567572
rcfiles = rcfiles,
@@ -570,13 +575,15 @@ fn pre_install_msg(no_modify_path: bool) -> Result<String> {
570575
} else {
571576
Ok(format!(
572577
pre_install_msg_win!(),
578+
cargo_home = cargo_home.display(),
573579
cargo_home_bin = cargo_home_bin.display(),
574580
rustup_home = rustup_home.display(),
575581
))
576582
}
577583
} else {
578584
Ok(format!(
579585
pre_install_msg_no_modify_path!(),
586+
cargo_home = cargo_home.display(),
580587
cargo_home_bin = cargo_home_bin.display(),
581588
rustup_home = rustup_home.display(),
582589
))

0 commit comments

Comments
 (0)