diff --git a/cwltool/pathmapper.py b/cwltool/pathmapper.py index c89fac5f4..7ed4437e6 100644 --- a/cwltool/pathmapper.py +++ b/cwltool/pathmapper.py @@ -178,6 +178,16 @@ def setup(self, referenced_files: List[CWLObjectType], basedir: str) -> None: staged=True, ) + targets: Dict[str, str] = {} + for k, v in self._pathmap.items(): + if v.target in targets: + raise ValidationException( + "Name conflict: both %s and %s have been assigned to target %s" + % (k, targets[v.target], v.target) + ) + if v.type != "Directory": + targets[v.target] = k + def mapper(self, src: str) -> MapperEnt: if "#" in src: i = src.index("#")