Skip to content

Commit

Permalink
Don't error on collision (#5138)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
stxue1 and github-actions[bot] authored Oct 31, 2024
1 parent 5c21767 commit 367f0ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/toil/cwl/cwltoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2366,7 +2366,12 @@ def _realpath(
# Probably staging and bypassing file store. Just copy.
logger.log(log_level, "Saving %s...", dest_url)
os.makedirs(os.path.dirname(p.target), exist_ok=True)
shutil.copyfile(p.resolved, p.target)
try:
shutil.copyfile(p.resolved, p.target)
except shutil.SameFileError:
# If outdir isn't set and we're passing through an input file/directory as the output,
# the file doesn't need to be copied because it is already there
pass
else:
uri = p.resolved
if not uri.startswith("toilfile:"):
Expand Down

0 comments on commit 367f0ad

Please sign in to comment.