mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Fix atomic_install
: Copy permissions of src
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
97bfeb7bd8
commit
d4105585db
1 changed files with 9 additions and 0 deletions
|
@ -211,6 +211,15 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> {
|
|||
);
|
||||
io::copy(&mut src_file, tempfile.as_file_mut())?;
|
||||
|
||||
debug!("Retrieving permissions of '{}'", src.display());
|
||||
let permissions = src_file.metadata()?.permissions();
|
||||
|
||||
debug!(
|
||||
"Setting permissions of '{}' to '{permissions:#?}'",
|
||||
tempfile.path().display()
|
||||
);
|
||||
tempfile.as_file().set_permissions(permissions)?;
|
||||
|
||||
debug!(
|
||||
"Persisting '{}' to '{}'",
|
||||
tempfile.path().display(),
|
||||
|
|
Loading…
Add table
Reference in a new issue