mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 14:46:37 +00:00
Fix self-install failure
reflink_or_copy now fails if the dest already exists
9e0b2cf427
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
bd8213e987
commit
f32549a8a3
1 changed files with 1 additions and 0 deletions
|
@ -33,6 +33,7 @@ fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result<NamedTempFile> {
|
|||
src.display(),
|
||||
tempfile.path().display()
|
||||
);
|
||||
fs::remove_file(tempfile.path())?;
|
||||
// src and dst is likely to be on the same filesystem.
|
||||
// Uses reflink if the fs support it, or fallback to
|
||||
// `fs::copy` if it doesn't support it or it is not on the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue