mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-26 18:58:26 +02:00
Restructure add plugin
This commit is contained in:
@@ -55,9 +55,7 @@ pub async fn download_and_install<R: Runtime>(
|
||||
zip_extract::extract(Cursor::new(&bytes), &plugin_dir, true)?;
|
||||
info!("Extracted plugin {} to {}", plugin_version.id, plugin_dir_str);
|
||||
|
||||
plugin_manager.add_plugin_by_dir(&PluginContext::new(&window), &plugin_dir_str, true).await?;
|
||||
|
||||
window.db().upsert_plugin(
|
||||
let plugin = window.db().upsert_plugin(
|
||||
&Plugin {
|
||||
id: plugin_version.id.clone(),
|
||||
checked_at: Some(Utc::now().naive_utc()),
|
||||
@@ -69,6 +67,8 @@ pub async fn download_and_install<R: Runtime>(
|
||||
&UpdateSource::Background,
|
||||
)?;
|
||||
|
||||
plugin_manager.add_plugin(&PluginContext::new(&window), &plugin).await?;
|
||||
|
||||
info!("Installed plugin {} to {}", plugin_version.id, plugin_dir_str);
|
||||
|
||||
Ok(plugin_version)
|
||||
|
||||
Reference in New Issue
Block a user