Skip to content

Commit

Permalink
print the full destination path when no track duplicates
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 committed Aug 31, 2021
1 parent c227565 commit 5da9bed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/cargo/ops/cargo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
if !self.force && !duplicates.is_empty() {
let mut msg: Vec<String> = duplicates
.iter()
.map(|(name, _)| format!("binary `{}` already exists in destination", name))
.map(|(name, _)| {
format!(
"binary `{}` already exists in destination `{}`",
name,
dst.join(name).to_string_lossy()
)
})
.collect();
msg.push("Add --force to overwrite".to_string());
bail!("{}", msg.join("\n"));
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/install_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ fn no_track() {
.with_stderr(
"\
[UPDATING] `[..]` index
[ERROR] binary `foo[EXE]` already exists in destination
[ERROR] binary `foo[EXE]` already exists in destination `[..]/.cargo/bin/foo`
Add --force to overwrite
",
)
Expand Down

0 comments on commit 5da9bed

Please sign in to comment.