print the full destination path when no track duplicates

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2021-08-28 12:57:41 +08:00
parent c22756541a
commit 5da9bed1e5
2 changed files with 8 additions and 2 deletions

View File

@ -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"));

View File

@ -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
",
)