Skip to content

Commit 4361ed9

Browse files
authored
Merge pull request #144 from longr/patch-5
Update 14-runtime.md
2 parents 573a438 + c88cbe8 commit 4361ed9

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

_episodes/14-runtime.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ To generate such files we can use the `InitialWorkDirRequirement`.
2626
~~~
2727
{: .source}
2828

29-
Any [expressions](../13-expressions/index.html) like `$(inputs.message)` are expanded by the CWL engine before creating the file; here inserting the value at the input `message`.
29+
Any [expressions](../13-expressions/index.html) like `$(inputs.message)` are
30+
expanded by the CWL engine before creating the file;
31+
here inserting the value at the input `message`.
3032

31-
> **Tip:** The _CWL expressions_ are independent of any _shell variables_ used later during command line tool invocation. That means that any genuine need for the character `$` should be **escaped** with `\`, for instance `\${PREFIX}` above is expanded to `${PREFIX}` in the generated file to be evaluated by the shell script instead of the CWL engine.
33+
> ## Tip
34+
> The _CWL expressions_ are independent of any _shell variables_
35+
used later during command line tool invocation. That means that any genuine
36+
need for the character `$` must be **escaped** with `\`,
37+
for instance `\${PREFIX}` above is expanded to `${PREFIX}` in the generated file
38+
to be evaluated by the shell script instead of the CWL engine.
39+
{: .callout}
3240

3341
To test the above CWL tool use this job to provide the input value `message`:
3442

@@ -39,6 +47,22 @@ To test the above CWL tool use this job to provide the input value `message`:
3947
~~~
4048
{: .source}
4149

50+
Before we run this, lets look at each step in a little more detail.
51+
The base command `baseCommand: ["sh", "example.sh"]`
52+
will execute the command `sh example.sh`.
53+
This will run the file we create in the shell.
54+
55+
`InitialWorkDirRequirement` requires a `listing`.
56+
As the `listing` is a YAML array we need a `-` on the first line of
57+
each element of the array, in this case we have just one element.
58+
`entryname:` can have any value,
59+
but it must match what was specified in the `baseCommand`.
60+
The final part is `entry:`, this is followed by `|-`
61+
which is YAML quoting syntax, and means that you are using a multiline string
62+
(without it we would need to write the whole script on one line).
63+
(see the [YAML Guide]({{ page.root }}{% link _extras/yaml.md %}#maps)
64+
for more about the formating)
65+
4266
Now invoke `cwl-runner` with the tool wrapper and the input object on the
4367
command line:
4468

0 commit comments

Comments
 (0)