Skip to content
Merged
Changes from all commits
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
11 changes: 7 additions & 4 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ macro_rules! pre_install_msg_unix {
() => {
pre_install_msg_template!(
"This path will then be added to your `PATH` environment variable by
modifying the profile file located at:
modifying the profile file{plural} located at:

{rcfiles}"
{rcfiles}"
)};
}

Expand Down Expand Up @@ -492,10 +492,13 @@ fn pre_install_msg(no_modify_path: bool) -> Result<String> {
None
}
}).collect::<Vec<_>>();
assert_eq!(rcfiles.len(), 1); // Only modifying .profile
let plural = if rcfiles.len() > 1 { "s" } else { "" };
let rcfiles = rcfiles.into_iter().map(|f| format!(" {}", f)).collect::<Vec<_>>();
let rcfiles = rcfiles.join("\n");
Ok(format!(pre_install_msg_unix!(),
cargo_home_bin = cargo_home_bin.display(),
rcfiles = rcfiles[0]))
plural = plural,
rcfiles = rcfiles))
} else {
Ok(format!(pre_install_msg_win!(),
cargo_home_bin = cargo_home_bin.display()))
Expand Down