Profile imports (#348)

* temporary switch

* draft; working unmanaged + modrinth

* working update

* added checkerg

* fixed io merge issue

* Added api handling

* tidying up

* reverted playground changes

* fixed js issue

* fixed merge issues
This commit is contained in:
Wyatt Verchere
2023-07-22 12:37:19 -07:00
committed by GitHub
parent 3fa33dc241
commit 70aaf6eef9
20 changed files with 1440 additions and 127 deletions

View File

@@ -135,6 +135,21 @@ pub async fn rename(
})
}
// copy
pub async fn copy(
from: impl AsRef<std::path::Path>,
to: impl AsRef<std::path::Path>,
) -> Result<u64, IOError> {
let from = from.as_ref();
let to = to.as_ref();
tokio::fs::copy(from, to)
.await
.map_err(|e| IOError::IOPathError {
source: e,
path: from.to_string_lossy().to_string(),
})
}
// remove file
pub async fn remove_file(
path: impl AsRef<std::path::Path>,