Skip to content

Commit 448ae30

Browse files
committed
fix: copy files if we couldn't move them
1 parent 76badac commit 448ae30

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cwltool/process.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ def _relocate(src, dst):
299299
if src == dst:
300300
return
301301

302-
if action == "move":
302+
_action = action
303+
if _action == "move":
303304
# do not move anything if we are trying to move an entity from
304305
# outside of the source directories
305306
if any(os.path.commonprefix([path, src]) == path for path in source_directories):
@@ -310,8 +311,11 @@ def _relocate(src, dst):
310311
_relocate(dir_entry.path, fs_access.join(dst, dir_entry.name))
311312
else:
312313
shutil.move(src, dst)
314+
else:
315+
# we still need the files at the destination, so let's copy them
316+
_action = "copy"
313317

314-
elif action == "copy":
318+
if _action == "copy":
315319
_logger.debug("Copying %s to %s", src, dst)
316320
if fs_access.isdir(src):
317321
if os.path.isdir(dst):

0 commit comments

Comments
 (0)