Skip to content

Commit c0d1e62

Browse files
authored
Merge pull request #634 from common-workflow-language/v1.1/empty-array-input
Do not add anything to command line if input array is empty
2 parents 92abb4e + da702a5 commit c0d1e62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cwltool/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def generate_arg(self, binding): # type: (Dict[Text,Any]) -> List[Text]
215215

216216
l = [] # type: List[Dict[Text,Text]]
217217
if isinstance(value, list):
218-
if binding.get("itemSeparator"):
218+
if binding.get("itemSeparator") and value:
219219
l = [binding["itemSeparator"].join([self.tostr(v) for v in value])]
220220
elif binding.get("valueFrom"):
221221
value = [self.tostr(v) for v in value]
222222
return ([prefix] if prefix else []) + value
223-
elif prefix:
223+
elif prefix and value:
224224
return [prefix]
225225
else:
226226
return []

0 commit comments

Comments
 (0)