From a0511452f286625c17ed5032bed2647b1ae320f8 Mon Sep 17 00:00:00 2001 From: daniellga Date: Thu, 2 May 2024 23:23:23 -0300 Subject: [PATCH] fix --- Cargo.toml | 2 +- rdocs/DESCRIPTION | 2 +- src/main.rs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index adfee1e..c1bc002 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rdocs" -version = "0.1.44" +version = "0.1.45" edition = "2021" repository = "https://github.com/daniellga/rdocs/" diff --git a/rdocs/DESCRIPTION b/rdocs/DESCRIPTION index ff77542..1494a08 100644 --- a/rdocs/DESCRIPTION +++ b/rdocs/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdocs Title: Create Quarto documentation for R files from comments -Version: 0.1.44 +Version: 0.1.45 Authors@R: person("Daniel", "Gurgel", , "daniellga@gmail.com", role = c("aut", "cre")) Description: Generate R documentation in Quarto format based on comments in code files. diff --git a/src/main.rs b/src/main.rs index f35b407..71f3054 100644 --- a/src/main.rs +++ b/src/main.rs @@ -206,6 +206,9 @@ fn eval_examples(mut examples: Vec) { // Iterate for each example chunk in the file. for example in output_text.split("***end_of_example;") { + if example.is_empty() { + continue; + } let output = Command::new("Rscript") .args(["--vanilla", "-e", example]) .stdout(Stdio::null()) @@ -216,7 +219,7 @@ fn eval_examples(mut examples: Vec) { if !output.status.success() { let error_message = String::from_utf8_lossy(&output.stderr); panic!( - "Error running example:\n\n{}\n\n**********\n\nR code executed:\n\n{}", + "Error running R example:\n{}\nR code executed which generated error:\n{}", error_message, example ); }