Dear All,
I have small Shell script to write the lines in a file to another file
writer.sh
#!/usr/bin/env bash
infile=$1
outfile=$2
while read line
do
echo $line >> "$outfile"
done < "$infile"
I converted it for CWL as following, writer.cwl
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [sh,writer.sh]
inputs:
infile:
type: File
inputBinding:
position: 1
outfile:
type: string
inputBinding:
position: 2
outputs:
out_message:
type: File
outputBinding:
glob: $(inputs.outfile)
And the YML writer.yml file looks as following,
infile:
class: File
path: /user/home/hello.txt
outfile: monday.txt
class: File
path: /user/home/tuesday.txt
When I run as following, cwltool writer.cwl writer.yml. it is throwing permanent fail error as,
[job writer.cwl] /tmp/tmpmht4svls$ sh \
search.sh \
/tmp/tmpv3evb_ic/stg1a74b4ca-15ba-4d28-9598-62b7604e8185/hello.txt \
monday.txt
sh: writer.sh: No such file or directory
[job writer.cwl] Job error:
Error collecting output for parameter 'out_message':
writer.cw.cwl:18:2: Traceback (most recent call last):
writer.cw.cwl:18:2:
writer.cw:18:2: File "/cluster/home/aalva/.local/venvs/cwltool/lib/python3.6/site-packages/cwltool/command_line_tool.py", line 724, in collect_output
writer.cwl: 18:2: raise WorkflowException("Did not find output file with glob pattern: '{}'".format(globpatterns))
writer.cwl:18:2:
writer.cwl:18:2: cwltool.errors.WorkflowException: Did not find output file with glob pattern: '['monday.txt']'
writer.cwl:18:2:
writer.cwl:21:4: cwltool.errors.WorkflowException: Did not find output file with glob pattern: '['monday.txt']'
[job writer.cwl] completed permanentFail
[job writer.cwll] {}
[job writer.cwll] Removing input staging directory /tmp/tmpv3evb_ic
[job writer.cwl] Removing temporary directory /tmp/tmp8v9yxvvo
{}
Final process status is permanentFail
I am not understanding what is wrong here.Any suggestions would be appreciated
cwl