about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2021-03-07 03:41:25 +0530
committerArun Isaac2021-03-07 03:53:51 +0530
commited11f7058c087eec189bc34619fa0b271b1e1440 (patch)
tree1cac4866789602e95b32aeee13eaf17a41f2d238
parent6f398db2fc89f0703ab022018689b99e45365ff6 (diff)
downloadccwl-ed11f7058c087eec189bc34619fa0b271b1e1440.tar.gz
ccwl-ed11f7058c087eec189bc34619fa0b271b1e1440.tar.lz
ccwl-ed11f7058c087eec189bc34619fa0b271b1e1440.zip
Add write-cwl function to write generated CWL to a file.
* ccwl/ccwl.scm: Import (srfi srfi-26) and (ccwl yaml).
(write-cwl): New public function.
-rw-r--r--ccwl/ccwl.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index b1fa485..120edcd 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -7,13 +7,16 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-9 gnu)
+  #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
+  #:use-module (ccwl yaml)
   #:export (command
             workflow
             input
             output
             step
-            pipeline))
+            pipeline
+            write-cwl))
 
 (define-immutable-record-type <input>
   (make-input id type label default source other)
@@ -252,3 +255,7 @@ re-matched."
                                      (input-id (command-stdin command))
                                      ".path)")))
           '())))
+
+(define (write-cwl step file)
+  (call-with-output-file file
+    (cut scm->yaml (step-run step) <>)))