feat: add windows support (#259)

* feat: add windows support

* Cleanup
This commit is contained in:
Bryan Oltman
2024-12-20 17:35:28 -05:00
committed by GitHub
parent 54e1e2ce2f
commit 71b5ed65fa
+8 -1
View File
@@ -313,6 +313,7 @@ fn check_hash(path: &Path, expected_string: &str) -> anyhow::Result<()> {
}
impl ReadSeek for Cursor<Vec<u8>> {}
impl ReadSeek for fs::File {}
#[cfg(any(target_os = "android", test))]
fn patch_base(config: &UpdateConfig) -> anyhow::Result<Box<dyn ReadSeek>> {
@@ -320,7 +321,13 @@ fn patch_base(config: &UpdateConfig) -> anyhow::Result<Box<dyn ReadSeek>> {
Ok(Box::new(base_r))
}
#[cfg(not(any(target_os = "android", test)))]
#[cfg(all(target_os = "windows", not(test)))]
fn patch_base(config: &UpdateConfig) -> anyhow::Result<Box<dyn ReadSeek>> {
let file = fs::File::open(&config.libapp_path)?;
Ok(Box::new(file))
}
#[cfg(not(any(target_os = "android", target_os = "windows", test)))]
fn patch_base(config: &UpdateConfig) -> anyhow::Result<Box<dyn ReadSeek>> {
config.file_provider.open()
}