From ed11f7058c087eec189bc34619fa0b271b1e1440 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 7 Mar 2021 03:41:25 +0530 Subject: 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. --- ccwl/ccwl.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 (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) <>))) -- cgit v1.2.3