Skip to content

Commit fbf4c06

Browse files
committed
Merge branch 'exitCode' of github.com:common-workflow-language/cwltool into inputBinding.position-expr
2 parents 99fd1cd + 0fa15e1 commit fbf4c06

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

cwltool/command_line_tool.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,17 @@ def collect_output_ports(self,
592592
ports, # type: Set[Dict[Text, Any]]
593593
builder, # type: Builder
594594
outdir, # type: Text
595+
rcode, # type: int
595596
compute_checksum=True, # type: bool
596597
jobname="", # type: Text
597598
readers=None # type: Dict[Text, Any]
598599
): # type: (...) -> OutputPorts
599600
ret = {} # type: OutputPorts
600601
debug = _logger.isEnabledFor(logging.DEBUG)
602+
cwl_version = self.metadata.get(
603+
"http://commonwl.org/cwltool#original_cwlVersion", None)
604+
if cwl_version != "v1.0":
605+
builder.resources["exitCode"] = rcode
601606
try:
602607
fs_access = builder.make_fs_access(outdir)
603608
custom_output = fs_access.join(outdir, "cwl.output.json")

cwltool/job.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ def __init__(self,
187187
self.generatemapper = None # type: Optional[PathMapper]
188188

189189
# set in CommandLineTool.job(i)
190-
self.collect_outputs = cast(Callable[[Any], Any],
191-
None) # type: Union[Callable[[Any], Any], functools.partial[Any]]
190+
self.collect_outputs = cast(Callable[[Text, int], MutableMapping[Text, Any]],
191+
None) # type: Union[Callable[[Text, int], MutableMapping[Text, Any]], functools.partial[MutableMapping[Text, Any]]]
192192
self.output_callback = cast(Callable[[Any, Any], Any], None)
193193
self.outdir = u""
194194
self.tmpdir = u""
@@ -261,7 +261,7 @@ def _execute(self,
261261
assert runtimeContext.prov_obj is not None
262262
runtimeContext.prov_obj.used_artefacts(
263263
job_order, runtimeContext.process_run_id, str(self.name))
264-
outputs = {} # type: Dict[Text,Text]
264+
outputs = {} # type: MutableMapping[Text,Any]
265265
try:
266266
stdin_path = None
267267
if self.stdin is not None:
@@ -328,7 +328,7 @@ def _execute(self,
328328
self.generatemapper, self.outdir, self.builder.outdir,
329329
inplace_update=self.inplace_update)
330330

331-
outputs = self.collect_outputs(self.outdir)
331+
outputs = self.collect_outputs(self.outdir, rcode)
332332
outputs = bytes2str_in_dicts(outputs) # type: ignore
333333
except OSError as e:
334334
if e.errno == 2:

0 commit comments

Comments
 (0)