aboutsummaryrefslogtreecommitdiff
path: root/ccwl
diff options
context:
space:
mode:
authorArun Isaac2023-09-28 22:48:59 +0100
committerArun Isaac2023-09-28 22:59:49 +0100
commita5fa8d018e650cf359e4ecd8774c600ccf7cade0 (patch)
treebb854739c4121942d57950158b17e9d114c2d8ce /ccwl
parent8319713ba08ae0127d5018143012c0e6a4211cb3 (diff)
downloadccwl-a5fa8d018e650cf359e4ecd8774c600ccf7cade0.tar.gz
ccwl-a5fa8d018e650cf359e4ecd8774c600ccf7cade0.tar.lz
ccwl-a5fa8d018e650cf359e4ecd8774c600ccf7cade0.zip
cwl: Add generic workflow or command serialization function.
* ccwl/cwl.scm (workflow-or-command->cwl): New public function.
Diffstat (limited to 'ccwl')
-rw-r--r--ccwl/cwl.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/ccwl/cwl.scm b/ccwl/cwl.scm
index 30ec6ec..4c4fef0 100644
--- a/ccwl/cwl.scm
+++ b/ccwl/cwl.scm
@@ -29,10 +29,18 @@
#:use-module (ccwl utils)
#:use-module (ccwl yaml)
#:export (workflow->cwl
- command->cwl))
+ command->cwl
+ workflow-or-command->cwl))
(define %cwl-version "v1.2")
+(define workflow-or-command->cwl
+ (match-lambda*
+ (((? workflow? workflow) port)
+ (workflow->cwl workflow port))
+ (((? command? command) port)
+ (command->cwl command port))))
+
(define (workflow->cwl workflow port)
"Render WORKFLOW, a <workflow> object, to PORT as a CWL YAML
specification."