Skip to content

Commit

Permalink
add client_extra_dir param to client_started
Browse files Browse the repository at this point in the history
  • Loading branch information
little-dude committed Mar 13, 2018
1 parent dd07371 commit 4ab88f0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use futures::{future, Future};
use serde_json::Value;
use errors::ClientError;
use protocol;
use serde_json::{from_value, to_value};
use serde_json::{from_value, to_value, Map};
use serde::Serialize;
use structs::ViewId;

Expand Down Expand Up @@ -222,12 +222,15 @@ impl Client {
Box::new(self.notify("set_theme", params).and_then(|_| Ok(())))
}

pub fn client_started(&mut self, config_dir: Option<&str>) -> ClientResult<()> {
let params = match config_dir {
Some(path) => json!({"config_dir":path}),
None => json!({})
};
self.notify("client_started", params)
pub fn client_started(&mut self, config_dir: Option<&str>, client_extra_dir: Option<&str>) -> ClientResult<()> {
let mut params = Map::new();
if let Some(path) = config_dir {
let _ = params.insert("config_dir".into(), json!(path));
}
if let Some(path) = client_extra_dir {
let _ = params.insert("client_extra_dir".into(), json!(path));
}
self.notify("client_started", params.into())
}

pub fn start_plugin(&mut self, view_id: ViewId, name: &str) -> ClientResult<()> {
Expand Down

0 comments on commit 4ab88f0

Please sign in to comment.