Skip to content

Commit af3768f

Browse files
committed
fix: do not copy files after moving them
1 parent efcdd4e commit af3768f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

cwltool/process.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,16 @@ def _relocate(src, dst):
312312
shutil.move(src, dst)
313313
return
314314

315-
_logger.debug("Copying %s to %s", src, dst)
316-
if fs_access.isdir(src):
317-
if os.path.isdir(dst):
318-
shutil.rmtree(dst)
319-
elif os.path.isfile(dst):
320-
os.unlink(dst)
321-
shutil.copytree(src, dst)
322-
else:
323-
shutil.copy2(src, dst)
315+
elif action == "copy":
316+
_logger.debug("Copying %s to %s", src, dst)
317+
if fs_access.isdir(src):
318+
if os.path.isdir(dst):
319+
shutil.rmtree(dst)
320+
elif os.path.isfile(dst):
321+
os.unlink(dst)
322+
shutil.copytree(src, dst)
323+
else:
324+
shutil.copy2(src, dst)
324325

325326
outfiles = list(_collectDirEntries(outputObj))
326327
pm = path_mapper(outfiles, "", destination_path, separateDirs=False)

0 commit comments

Comments
 (0)