Skip to content

Commit a26fe2d

Browse files
author
Kaushik Ghose
committed
Add file staging example
1 parent bcfb114 commit a26fe2d

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ _Some patterns commonly encountered when writing CWL workflows_
1111
- [I don't want to escape the `$`](#i-dont-want-to-escape-the-)
1212
- [Embedding a bash script (style 2)](#embedding-a-bash-script-style-2)
1313
- [Manipulating a list of files using expressions](#manipulating-a-list-of-files-using-expressions)
14+
- [Link input files to working directory](#link-input-files-to-working-directory)
1415

1516
<!-- /TOC -->
1617

@@ -79,3 +80,12 @@ in the syntax accepted by the script.
7980

8081
Here is an example for [Python](list-of-files-python.cwl) and for
8182
[bash](list-of-files-bash.cwl)
83+
84+
85+
## Link input files to working directory
86+
> I have a tool that does not do well with arbitrary file paths. I'd like to
87+
> link the files into the working directory so I don't have to deal with
88+
> arbitrary mount paths and so on.
89+
90+
You can use `InitialWorkDirRequirement` to link the files
91+
([example](stage-files.cwl)).

‎stage-files.cwl‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
inputs:
4+
files: File[]
5+
outputs:
6+
out:
7+
type: stdout
8+
stdout: output.txt
9+
baseCommand: ["ls", "-al"]
10+
requirements:
11+
InitialWorkDirRequirement:
12+
listing: $(inputs.files)

0 commit comments

Comments
 (0)