mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-09-16 23:01:31 +02:00
chore(plugins): replace deprecated zip-extract with zip
This commit is contained in:
@@ -27,4 +27,4 @@ yaak-common = { workspace = true }
|
||||
yaak-crypto = { workspace = true }
|
||||
yaak-models = { workspace = true }
|
||||
yaak-templates = { workspace = true }
|
||||
zip-extract = "0.4.0"
|
||||
zip = "7"
|
||||
|
||||
@@ -43,7 +43,7 @@ pub enum Error {
|
||||
PluginErr(String),
|
||||
|
||||
#[error("zip error: {0}")]
|
||||
ZipError(#[from] zip_extract::ZipExtractError),
|
||||
ZipError(#[from] zip::result::ZipError),
|
||||
|
||||
#[error("Client not initialized error")]
|
||||
ClientNotInitializedErr,
|
||||
|
||||
@@ -65,7 +65,8 @@ pub async fn download_and_install(
|
||||
let _ = remove_dir_all(&plugin_dir);
|
||||
create_dir_all(&plugin_dir)?;
|
||||
|
||||
zip_extract::extract(Cursor::new(&bytes), &plugin_dir, true)?;
|
||||
zip::ZipArchive::new(Cursor::new(&bytes))?
|
||||
.extract_unwrapped_root_dir(&plugin_dir, zip::read::root_dir_common_filter)?;
|
||||
info!("Extracted plugin {} to {}", plugin_version.id, plugin_dir_str);
|
||||
|
||||
let plugin = query_manager.with_tx(|db| {
|
||||
|
||||
Reference in New Issue
Block a user