Skip to content

Commit 3b85afc

Browse files
tetronmr-c
andcommitted
Adjust behavior of command_input_file_expression (#128)
Changes it to reference another input parameter instead of using self. The behavior of processing secondary files patterns in order and being able to reference earlier ones later is not part of the spec. This doesn't exactly replicate the previous behavior, because it introduces a new input parameter, however it does demonstrate the ability to rename a file and have it staged as a secondary file without having to use InitialWorkDir. refs #127 Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent 13ea3d1 commit 3b85afc

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

tests/secondaryfiles/rename-inputs.cwl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env cwl-runner
22
id: InputSecondaryFileConformanceTest
3-
baseCommand:
4-
- ls
53
class: CommandLineTool
64
cwlVersion: v1.2
75
doc: |
@@ -24,7 +22,6 @@ inputs:
2422
touch secondary_file_test.txt.accessory
2523
```
2624
secondaryFiles:
27-
- .accessory
2825
- |
2926
${
3027
function resolveSecondary(base, secPattern) {
@@ -37,19 +34,21 @@ inputs:
3734
}
3835
return [{
3936
"class": "File",
40-
"location": self.secondaryFiles[0].location,
37+
"location": inputs.accessory.location,
4138
"basename": resolveSecondary(self.basename, '^.accessory')
4239
}];
4340
}
41+
- id: accessory
42+
type: File
43+
4444

4545
arguments:
46+
- "ls"
47+
- $(inputs.inputWithSecondary.dirname)
4648
- valueFrom: "|"
4749
shellQuote: false
48-
position: 0
49-
- valueFrom: "grep"
50-
position: 1
51-
- valueFrom: "secondary"
52-
position: 2
50+
- "grep"
51+
- "secondary"
5352

5453
outputs:
5554
- id: output_file
@@ -58,6 +57,3 @@ stdout: result
5857
requirements:
5958
InlineJavascriptRequirement: {}
6059
ShellCommandRequirement: {}
61-
InitialWorkDirRequirement:
62-
listing:
63-
- $(inputs.inputWithSecondary)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
inputWithSecondary:
22
class: File
33
location: secondary_file_test.txt
4+
accessory:
5+
class: File
6+
location: secondary_file_test.txt.accessory

tests/secondaryfiles/test-index.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
checksum: sha1$901c3d387a263c57eaed6f24a82517c1fb0e198d
99
size: 54
1010
location: result
11-
tags: [ inline_javascript, secondary_files, command_line_tool ]
11+
tags: [ inline_javascript, secondary_files, command_line_tool, shell_command ]
1212

1313
- tool: rename-outputs.cwl
1414
doc: Confirm CommandOutputParameter expression can receive a File object

0 commit comments

Comments
 (0)