Skip to content

Commit 8f7f96d

Browse files
authored
Merge pull request #74 from wfcommons/cwl_bug
BUG: fixed incorrect template name and removed redundant code
2 parents 62f3215 + 652bb16 commit 8f7f96d

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

wfcommons/wfbench/translator/cwl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _parse_steps(self) -> None:
132132

133133
code = [
134134
f" {task.task_id}:",
135-
" run: clt/bash.cwl",
135+
" run: clt/shell.cwl",
136136
" in:",
137137
]
138138

@@ -224,7 +224,7 @@ def _write_cwl_files(self, output_folder: pathlib.Path) -> None:
224224
clt_folder.mkdir(exist_ok=True)
225225
shutil.copy(this_dir.joinpath("templates/cwl_templates/wfbench.cwl"), clt_folder)
226226
shutil.copy(this_dir.joinpath("templates/cwl_templates/folder.cwl"), clt_folder)
227-
shutil.copy(this_dir.joinpath("templates/cwl_templates/bash.cwl"), clt_folder)
227+
shutil.copy(this_dir.joinpath("templates/cwl_templates/shell.cwl"), clt_folder)
228228

229229
with open(cwl_folder.joinpath("main.cwl"), "w", encoding="utf-8") as f:
230230
f.write("\n".join(self.cwl_script))

wfcommons/wfbench/translator/templates/cwl_templates/shell.cwl

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,15 @@ class: CommandLineTool
33
requirements:
44
InlineJavascriptRequirement: {}
55
ShellCommandRequirement: {}
6-
stdout: $("logs/" + inputs.step_name + ".out")
7-
stderr: $("logs/" + inputs.step_name + ".err")
8-
9-
arguments:
10-
- position: 1
11-
valueFrom: >
12-
${
13-
var cmd = inputs.command;
14-
if (inputs.input_files) {
15-
for (var i = 0; i < inputs.input_files.length; i++) {
16-
cmd = cmd.replace(new RegExp(inputs.input_files[i].basename, 'g'), inputs.input_files[i].path);
17-
}
18-
}
19-
return cmd;
20-
}
21-
shellQuote: false
6+
stdout: $(inputs.step_name + ".out")
7+
stderr: $(inputs.step_name + ".err")
228

239
inputs:
2410
command:
2511
type: string
12+
inputBinding:
13+
position: 1
14+
shellQuote: false
2615
input_files:
2716
type: File[]?
2817
output_filenames:

0 commit comments

Comments
 (0)