mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 05:28:42 +00:00
Use atomic_symlink_file
in install_link
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
77ce57815c
commit
43238e39a3
1 changed files with 2 additions and 5 deletions
|
@ -4,7 +4,7 @@ use cargo_toml::Product;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::{atomic_install, BinstallError, PkgFmt, PkgMeta, Template};
|
use crate::{atomic_install, atomic_symlink_file, BinstallError, PkgFmt, PkgMeta, Template};
|
||||||
|
|
||||||
pub struct BinFile {
|
pub struct BinFile {
|
||||||
pub base_name: String,
|
pub base_name: String,
|
||||||
|
@ -103,10 +103,7 @@ impl BinFile {
|
||||||
self.link.display(),
|
self.link.display(),
|
||||||
dest.display()
|
dest.display()
|
||||||
);
|
);
|
||||||
#[cfg(target_family = "unix")]
|
atomic_symlink_file(dest, &self.link)?;
|
||||||
std::os::unix::fs::symlink(dest, &self.link)?;
|
|
||||||
#[cfg(target_family = "windows")]
|
|
||||||
std::os::windows::fs::symlink_file(dest, &self.link)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue