Skip to content

Commit 9accbf6

Browse files
author
Anton Khodak
committed
Do not add anything to command line if input array is empty
1 parent 0866dad commit 9accbf6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cwltool/builder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,11 @@ 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:
224-
return [prefix]
225223
else:
226224
return []
227225
elif isinstance(value, dict) and value.get("class") in ("File", "Directory"):

0 commit comments

Comments
 (0)