From 54808d5f4df0db3072f68501f3d9ea3fc9487691 Mon Sep 17 00:00:00 2001 From: Andrew Frantz Date: Thu, 9 Jan 2025 16:50:24 -0500 Subject: [PATCH] fix: print the correct fields from `Outputs` --- wdl-engine/src/outputs.rs | 2 +- wdl/src/cli.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wdl-engine/src/outputs.rs b/wdl-engine/src/outputs.rs index bdf99ab9..692a03f3 100644 --- a/wdl-engine/src/outputs.rs +++ b/wdl-engine/src/outputs.rs @@ -17,7 +17,7 @@ pub struct Outputs { /// for a direct task execution. name: Option, /// The map of output name to value. - values: IndexMap, + pub values: IndexMap, } impl Outputs { diff --git a/wdl/src/cli.rs b/wdl/src/cli.rs index 1cdeb722..517bef6c 100644 --- a/wdl/src/cli.rs +++ b/wdl/src/cli.rs @@ -43,7 +43,7 @@ pub async fn analyze( exceptions: Vec, lint: bool, shellcheck: bool, -) -> anyhow::Result> { +) -> Result> { let rules = analysis_rules(); let rules = rules .iter() @@ -108,7 +108,7 @@ pub async fn analyze( let results = analyzer.analyze(bar.clone()).await?; - Ok(results) + anyhow::Ok(results) } /// Validates the inputs for a task or workflow. @@ -117,7 +117,7 @@ pub async fn validate_inputs( inputs: &Path, stream: &mut codespan_reporting::term::termcolor::StandardStream, config: &codespan_reporting::term::Config, -) -> anyhow::Result<()> { +) -> Result<()> { if Path::new(&document).is_dir() { bail!("expected a WDL document, found a directory"); } @@ -194,7 +194,7 @@ pub async fn validate_inputs( bail!("failed to validate inputs:\n{result}"); } - Ok(()) + anyhow::Ok(()) } /// Run a WDL task or workflow. @@ -286,7 +286,7 @@ pub async fn run( { Ok(evaluated) => match evaluated.into_result() { Ok(outputs) => { - println!("{}", to_string_pretty(&outputs)?); + println!("{}", to_string_pretty(&outputs.values)?); } Err(e) => match e { EvaluationError::Source(diagnostic) => { @@ -330,5 +330,5 @@ pub async fn run( } } - Ok(()) + anyhow::Ok(()) }