Fix sink plugins

This commit is contained in:
Jonathan Turner
2019-08-09 19:54:21 +12:00
parent 83030094e0
commit cabd5bf009
4 changed files with 69 additions and 5 deletions

View File

@ -4,7 +4,7 @@ use crate::commands::classified::{
StreamNext,
};
use crate::commands::plugin::JsonRpc;
use crate::commands::plugin::PluginCommand;
use crate::commands::plugin::{PluginCommand, PluginSink};
use crate::commands::static_command;
use crate::context::Context;
crate use crate::errors::ShellError;
@ -72,6 +72,11 @@ fn load_plugin(path: &std::path::Path, context: &mut Context) -> Result<(), Shel
))]);
Ok(())
} else {
let fname = fname.to_string();
let name = params.name.clone();
context.add_commands(vec![static_command(PluginSink::new(
name, fname, params,
))]);
Ok(())
}
}