-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlist-of-files-python.cwl
More file actions
33 lines (30 loc) · 794 Bytes
/
list-of-files-python.cwl
File metadata and controls
33 lines (30 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# The javascript expression returns a string that is code for a python list
cwlVersion: v1.0
class: CommandLineTool
requirements:
InlineJavascriptRequirement: {}
InitialWorkDirRequirement:
listing:
- entryname: script.py
entry: |-
# The javascript expression returns a string that is code for
# a python list
file_array=[ ${
var l = "";
for( var i = 0; i < inputs.files.length; i++) {
if (i > 0) { l += ", "; }
l += "'" + inputs.files[i].path + "'";
}
return l;
}]
print(file_array)
inputs:
files:
type:
type: array
items: File
outputs:
example_out:
type: stdout
stdout: output.txt
baseCommand: ["python", "script.py"]