From 2b780be532ce858b348917432e303006ca45084b Mon Sep 17 00:00:00 2001 From: berrysweet Date: Thu, 6 Jul 2023 11:12:06 +0200 Subject: [PATCH] feat: add accepting input piped from jrnl --- Cargo.toml | 1 + src/main.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 948bc3e..c918f03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,4 @@ edition = "2021" confy = "0.5.1" serde = { version = "1.0.164", features = ["derive"] } walkdir = "2.3.3" +read_pipe = "0.1.2" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index ddfc8bc..5a889c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,12 @@ mod util { const APP_NAME: &str = "livejrnl-rs"; fn main() { + let mut jrnl_json: String = String::new(); + if let Some(pipe) = read_pipe::read_pipe() { + jrnl_json.push_str(&pipe); + } + println!("{:#?}", jrnl_json); + let config_data = load_config(); match config_data { Ok(config_data) => { -- libgit2 1.7.2