diff --git a/v1.0/conformance_test_v1.0.yaml b/v1.0/conformance_test_v1.0.yaml index e8a0d427..a6f721c4 100644 --- a/v1.0/conformance_test_v1.0.yaml +++ b/v1.0/conformance_test_v1.0.yaml @@ -1529,7 +1529,7 @@ "args": [] } tool: v1.0/empty-array-input.cwl - doc: "Test that empty array input does not add anything to command line" + doc: "Test that empty array input does not add anything to command line" tags: [ required ] - job: v1.0/empty.json @@ -1551,3 +1551,47 @@ tool: v1.0/valueFrom-constant.cwl doc: Test valueFrom with constant value overriding provided array inputs tags: [ inline_javascript ] + +- job: v1.0/new-dir-job.yml + output: { + "out": { + "checksum": "sha1$ada861e58d3ca64224d5b8ded8cd0e1e7f775057", + "class": "File", + "location": "output.txt", + "size": 26 + }, + "outdir": { + "location": "sample1", + "listing": [ + { + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "location": "sample1.bam", + "class": "File", + "size": 0 + }, + { + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "location": "sample1.other", + "class": "File", + "size": 0 + } + ], + "class": "Directory" + } + } + tool: v1.0/new-dir.cwl + doc: Test returning directory literal in expression for InitialWorkDir listing + tags: [ required ] + +- job: v1.0/empty.json + output: { + "out": { + "checksum": "sha1$2aae6c35c94fcfb415dbe95f408b9ce91ee846ed", + "class": "File", + "location": "output.txt", + "size": 11 + } + } + tool: v1.0/new-file.cwl + doc: Test returning file literal in expression for InitialWorkDir listing + tags: [ required ] \ No newline at end of file diff --git a/v1.0/v1.0/bams/sample1.bam b/v1.0/v1.0/bams/sample1.bam new file mode 100644 index 00000000..e69de29b diff --git a/v1.0/v1.0/bams/sample1.other b/v1.0/v1.0/bams/sample1.other new file mode 100644 index 00000000..e69de29b diff --git a/v1.0/v1.0/new-dir-job.yml b/v1.0/v1.0/new-dir-job.yml new file mode 100644 index 00000000..9877fabc --- /dev/null +++ b/v1.0/v1.0/new-dir-job.yml @@ -0,0 +1,4 @@ +input: + class: Directory + location: bams +# location: keep:d287705ded77ef04295b906135fad6b8+53 \ No newline at end of file diff --git a/v1.0/v1.0/new-dir.cwl b/v1.0/v1.0/new-dir.cwl new file mode 100644 index 00000000..39f49a12 --- /dev/null +++ b/v1.0/v1.0/new-dir.cwl @@ -0,0 +1,33 @@ +cwlVersion: v1.0 +class: CommandLineTool +requirements: + InlineJavascriptRequirement: {} + InitialWorkDirRequirement: + listing: | + ${ + var samplename = null; + var arr = []; + var bam = RegExp('.*\\.bam$') + for (var i in inputs.input.listing) { + if (!(samplename)) { + if (inputs.input.listing[i].basename.match(bam)) { + samplename = inputs.input.listing[i].basename.split('.')[0]; + } + } + } + var inputdir = {"class": "Directory", + "basename": samplename, + "listing": inputs.input.listing}; + arr.push(inputdir) + return arr; + } +inputs: + input: Directory +stdout: output.txt +outputs: + out: stdout + outdir: + type: Directory + outputBinding: + glob: sample1 +baseCommand: [ls, sample1/] \ No newline at end of file diff --git a/v1.0/v1.0/new-file.cwl b/v1.0/v1.0/new-file.cwl new file mode 100644 index 00000000..95a214d1 --- /dev/null +++ b/v1.0/v1.0/new-file.cwl @@ -0,0 +1,19 @@ +cwlVersion: v1.0 +class: CommandLineTool +requirements: + InlineJavascriptRequirement: {} + InitialWorkDirRequirement: + listing: | + ${ + var arr = []; + var inputfile = {"class": "File", + "basename": "input.txt", + "contents": "hello world"}; + arr.push(inputfile); + return arr; + } +inputs: [] +stdout: output.txt +outputs: + out: stdout +baseCommand: [cat, input.txt] \ No newline at end of file