From 125503ff3b613b08233fc1e06292be9ddd9dd448 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 13 Feb 2023 23:23:47 -0800 Subject: [PATCH] Fix CLI build on windows --- cli/src/util.rs | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/cli/src/util.rs b/cli/src/util.rs index 2b7405fd..d180cd54 100644 --- a/cli/src/util.rs +++ b/cli/src/util.rs @@ -13,7 +13,14 @@ use std::path::PathBuf; use std::process::{Child, ChildStdin, Command, Stdio}; #[cfg(unix)] -const HTML_HEADER: &[u8] = b"\n\n\n"; +const HTML_HEADER: &[u8] = b" + + + + +"; pub fn cancel_on_stdin() -> Arc { let result = Arc::new(AtomicUsize::new(0)); @@ -40,25 +47,30 @@ pub struct LogSession { dot_process_stdin: Option, } +#[cfg(windows)] +pub fn print_tree_graph(_tree: &Tree, _path: &str) -> Result<()> { + Ok(()) +} + +#[cfg(windows)] +pub fn log_graphs(_parser: &mut Parser, _path: &str) -> Result { + Ok(LogSession) +} + +#[cfg(unix)] pub fn print_tree_graph(tree: &Tree, path: &str) -> Result<()> { let session = LogSession::new(path)?; tree.print_dot_graph(session.dot_process_stdin.as_ref().unwrap()); Ok(()) } +#[cfg(unix)] pub fn log_graphs(parser: &mut Parser, path: &str) -> Result { let session = LogSession::new(path)?; parser.print_dot_graphs(session.dot_process_stdin.as_ref().unwrap()); Ok(session) } -#[cfg(windows)] -impl LogSession { - fn new(path: &str) -> Result { - Ok(Self) - } -} - #[cfg(unix)] impl LogSession { fn new(path: &str) -> Result {