feat: plugin serve support

This commit is contained in:
YuKun Liu committed 2022-08-27 10:41:15 -07:00
1 parent 6cce4b9f4d
commit 603aaa1c09
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -1,3 +1,5 @@
use crate::plugin::PluginManager;
use super::*; use super::*;
use std::{ use std::{
io::Write, io::Write,
@@ -14,7 +16,7 @@ pub struct Serve {
} }
impl 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()?; let mut crate_config = crate::CrateConfig::new()?;
// change the relase state. // change the relase state.
+1 -1
View File
@@ -31,7 +31,7 @@ async fn main() -> Result<()> {
} }
Commands::Serve(opts) => { 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); log::error!("🚫 Serve startup failed: {}", e);
} }
} }