Skip to content

Commit a98b555

Browse files
author
Toby Hodges
committed
added runtime requirement episode
1 parent bf39b0f commit a98b555

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

_episodes/14-runtime.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Creating Files at Runtime"
3+
teaching: 10
4+
exercises: 0
5+
questions:
6+
- "What do I do when I want to create values dynamically and CWL doesn't
7+
provide a built-in way of doing so?"
8+
objectives:
9+
- "Learn how to insert JavaScript expressions into a CWL description."
10+
keypoints:
11+
- "Use `InitialWorkDirRequirement` to specify input files that need to be
12+
created during tool runtime."
13+
---
14+
Sometimes you need to create a file on the fly from input parameters,
15+
such as tools which expect to read their input configuration from a file
16+
rather than the command line parameters. To do this, use
17+
`InitialWorkDirRequirement`.
18+
19+
*createfile.cwl*
20+
21+
```
22+
{% include cwl/createfile.cwl %}
23+
```
24+
25+
*echo-job.yml*
26+
27+
```
28+
{% include cwl/echo-job.yml %}
29+
```
30+
31+
Now invoke `cwl-runner` with the tool wrapper and the input object on the
32+
command line:
33+
34+
```
35+
$ cwltool createfile.cwl echo-job.yml
36+
[job 140528604979344] /home/example$ cat example.conf
37+
CONFIGVAR=Hello world!
38+
Final process status is success
39+
{}
40+
```

0 commit comments

Comments
 (0)