From 603aaa1c0952ad029a162ea4375b6f2a16b80511 Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Sat, 27 Aug 2022 10:41:15 -0700 Subject: [PATCH] feat: plugin `serve` support --- src/cli/serve/mod.rs | 4 +++- src/main.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 93770b6ed..bb24c1e83 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,3 +1,5 @@ +use crate::plugin::PluginManager; + use super::*; use std::{ io::Write, @@ -14,7 +16,7 @@ pub struct Serve { } impl Serve { - pub async fn serve(self) -> Result<()> { + pub async fn serve(self, plugin_manager: PluginManager) -> Result<()> { let mut crate_config = crate::CrateConfig::new()?; // change the relase state. diff --git a/src/main.rs b/src/main.rs index e7b96d4b5..873aa4bf7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,7 @@ async fn main() -> Result<()> { } Commands::Serve(opts) => { - if let Err(e) = opts.serve().await { + if let Err(e) = opts.serve(plugin_manager).await { log::error!("🚫 Serve startup failed: {}", e); } }