You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _episodes/14-runtime.md
+26-2Lines changed: 26 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,17 @@ To generate such files we can use the `InitialWorkDirRequirement`.
26
26
~~~
27
27
{: .source}
28
28
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`.
30
32
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}
32
40
33
41
To test the above CWL tool use this job to provide the input value `message`:
34
42
@@ -39,6 +47,22 @@ To test the above CWL tool use this job to provide the input value `message`:
39
47
~~~
40
48
{: .source}
41
49
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
+
42
66
Now invoke `cwl-runner` with the tool wrapper and the input object on the
0 commit comments