Skip to content

Commit 2c31446

Browse files
committed
restore previous logic
Yes, a bit odd that `class: Directory` objects in `listing` had a `dirname`, but we are temporarily using that (and fixing them) for setting the outdir when updating the Pathmapper. Then the `dirname` fields are removed immediately after.
1 parent 5caf59d commit 2c31446

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cwltool/command_line_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,17 +757,17 @@ def _initialworkdir(self, j: JobBase | None, builder: Builder) -> None:
757757
if "basename" in entry:
758758
basename = cast(str, entry["basename"])
759759
entry["basename"] = os.path.basename(basename)
760+
dirname = os.path.join(builder.outdir, os.path.dirname(basename))
761+
entry["dirname"] = dirname
760762
if is_file(entry):
761-
dirname = os.path.join(builder.outdir, os.path.dirname(basename))
762-
entry["dirname"] = dirname
763763
if "secondaryFiles" in entry:
764764
for sec_file in cast(
765765
MutableSequence[CWLObjectType], entry["secondaryFiles"]
766766
):
767767
sec_file["dirname"] = dirname
768768
normalizeFilesDirs(entry)
769769
self.updatePathmap(
770-
(entry.get("dirname") if is_file(entry) else None) or builder.outdir,
770+
cast(Optional[str], entry.get("dirname")) or builder.outdir,
771771
cast(PathMapper, builder.pathmapper),
772772
entry,
773773
)

0 commit comments

Comments
 (0)