common-workflow-language / common-workflow-language/cwltool
InitialWorkDirRequirement entry expression
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
## Expected Behavior
Create a directory `data` and then populate it with `inputs.sam` in the temporary working directory. This seems like it should have been resolved in #614 but in my testing it did not work in any recent version.
## Actual Behavior
Crashses
## Workflow Code
```
cwlVersion: v1.0
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: biocontainers/samtools
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entry: |
${
return {"class": "Directory", "basename": 'data', "listing": [inputs.sam]}
}
writable: true
inputs:
sam: File
bam_name: string
outputs:
bamout:
type: Directory
outputBinding:
glob: "data/"
baseCommand: []
arguments: ["samtools","view", "-Sb", "$(inputs.sam)", "-o", "$(inputs.bam_name)"]
```
## Full Traceback
```pytb
/home/kevin/example/final/bin/cwltool 1.0.20180711112827
Resolved 'test.cwl' to 'file:///home/kevin/example/test.cwl'
Got workflow error
Traceback (most recent call last):
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/executors.py", line 141, in run_jobs
for job in jobiter:
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/command_line_tool.py", line 492, in job
normalizeFilesDirs(j.generatefiles)
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 82, in normalizeFilesDirs
visit_class(job, ("File", "Directory"), addLocation)
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/utils.py", line 230, in visit_class
visit_class(rec[d], cls, op)
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/utils.py", line 233, in visit_class
visit_class(d, cls, op)
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/utils.py", line 228, in visit_class
op(rec)
File "/home/kevin/example/final/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 80, in addLocation
d["nameroot"], d["nameext"] = os.path.splitext(d["basename"])
File "/home/kevin/example/final/lib/python2.7/posixpath.py", line 98, in splitext
return genericpath._splitext(p, sep, altsep, extsep)
File "/home/kevin/example/final/lib/python2.7/genericpath.py", line 99, in _splitext
sepIndex = p.rfind(sep)
AttributeError: 'NoneType' object has no attribute 'rfind'
Workflow error, try again with --debug for more information:
'NoneType' object has no attribute 'rfind'
```
## Your Environment
* cwltool version: 1.0.20180130110340 (Working)
* cwltool version: 1.0.20180711112827 (not working)
Check using ``cwltool --version``
Contributor guide
Assessment
This issue has not been assessed yet.