From 4777ba4b46a0f5e3fdc620196e960d05fc703b01 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Sun, 9 Nov 2025 22:11:19 +0100 Subject: [PATCH] printing missing binary in the case something is missing. testing later --- src/app/build/asciidoctor.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/build/asciidoctor.rs b/src/app/build/asciidoctor.rs index 1b44433..49c027a 100644 --- a/src/app/build/asciidoctor.rs +++ b/src/app/build/asciidoctor.rs @@ -12,9 +12,11 @@ fn exec_command(command: &mut process::Command) -> Result<(), String> { } } else { println!("{}", result.unwrap_err()); - return Err( - "asciidoctor not installed. For more information run docki health!".to_string(), - ); + let binary_name = command.get_args().next(); + return Err(format!( + "{} not installed. For more information run docki health!", + binary_name.unwrap_or("Something is") + )); } } @@ -31,11 +33,11 @@ fn asciidoctor_docs(in_path: &str, out_path: &str) -> process::Command { fn asciidoctor_slides(in_path: &str, out_path: &str, offline_reveal: bool) -> process::Command { let mut command = process::Command::new(format!("asciidoctor-revealjs")); let out_dir = parent_path(out_path); - let revealjs_path = if offline_reveal { - path_between(out_dir.to_string(), "./dist/slides/revealjs".to_string()) - } else { - "https://cdn.jsdelivr.net/npm/reveal.js@5.2.1".to_string() - }; + let revealjs_path = if offline_reveal { + path_between(out_dir.to_string(), "./dist/slides/revealjs".to_string()) + } else { + "https://cdn.jsdelivr.net/npm/reveal.js@5.2.1".to_string() + }; command .arg(format!("{in_path}"))