mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 19:10:35 +00:00
fix: add missing awaits
This commit is contained in:
parent
b7444566dd
commit
ab9124e02c
1 changed files with 6 additions and 6 deletions
|
@ -39,13 +39,13 @@ pub enum PackageFS {
|
||||||
Copy(PathBuf, TargetKind),
|
Copy(PathBuf, TargetKind),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_readonly(_file: &fs::File) -> std::io::Result<()> {
|
async fn make_readonly(_file: &fs::File) -> std::io::Result<()> {
|
||||||
// on Windows, file deletion is disallowed if the file is read-only which breaks patching
|
// on Windows, file deletion is disallowed if the file is read-only which breaks patching
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
let mut permissions = _file.metadata()?.permissions();
|
let mut permissions = _file.metadata().await?.permissions();
|
||||||
permissions.set_readonly(true);
|
permissions.set_readonly(true);
|
||||||
_file.set_permissions(permissions)
|
_file.set_permissions(permissions).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -99,7 +99,7 @@ pub(crate) async fn store_in_cas<
|
||||||
|
|
||||||
match temp_path.persist_noclobber(&cas_path) {
|
match temp_path.persist_noclobber(&cas_path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
make_readonly(&file_writer.into_inner())?;
|
make_readonly(&file_writer.into_inner()).await?;
|
||||||
}
|
}
|
||||||
Err(e) if e.error.kind() == std::io::ErrorKind::AlreadyExists => {}
|
Err(e) if e.error.kind() == std::io::ErrorKind::AlreadyExists => {}
|
||||||
Err(e) => return Err(e.error),
|
Err(e) => return Err(e.error),
|
||||||
|
@ -138,10 +138,10 @@ impl PackageFS {
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
let mut permissions = f.metadata()?.permissions();
|
let mut permissions = f.metadata().await?.permissions();
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
permissions.set_mode(permissions.mode() | 0o644);
|
permissions.set_mode(permissions.mode() | 0o644);
|
||||||
f.set_permissions(permissions)?;
|
f.set_permissions(permissions).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue