From fb91a02460b22501cc1c57dc381a486a29b01fbd Mon Sep 17 00:00:00 2001
From: DavyCats <davycats.dc@gmail.com>
Date: Thu, 27 Jan 2022 12:01:28 +0100
Subject: [PATCH] update healthchecker

---
 hmftools.wdl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/hmftools.wdl b/hmftools.wdl
index 0b4ba6d..76620e3 100644
--- a/hmftools.wdl
+++ b/hmftools.wdl
@@ -408,13 +408,16 @@ task HealthChecker {
         -tum_flagstat_file ~{tumorFlagstats} \
         -tum_wgs_metrics_file ~{tumorMetrics} \
         -purple_dir ~{sub(purpleOutput[0], basename(purpleOutput[0]), "")} \
-        -output_dir ~{outputDir}   
+        -output_dir ~{outputDir}
+        test -e '~{outputDir}/~{tumorName}.HealthCheckSucceeded' && echo 'true' > '~{outputDir}/succeeded'
+        test -e '~{outputDir}/~{tumorName}.HealthCheckFailed' && echo 'false' > '~{outputDir}/succeeded'
     }
- 
 
     output {
-        File? healthCheckSucceeded = "~{outputDir}/~{tumorName}.HealthCheckSucceeded"
-        File? healthCheckFailed = "~{outputDir}/~{tumorName}.HealthCheckFailed"
+        Boolean succeeded = read_boolean("result")
+        File outputFile = if succeeded 
+                          then "~{outputDir}/~{tumorName}.HealthCheckSucceeded"
+                          else "~{outputDir}/~{tumorName}.HealthCheckFailed"
     }
 
     runtime {
-- 
GitLab