Skip to content

Commit 8194b56

Browse files
authored
Fix for directory literals returned by InitialWorkDir expression. (#697)
1 parent 39968ee commit 8194b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cwltool/job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ def relink_initialworkdir(pathmapper, host_outdir, container_outdir, inplace_upd
114114
host_outdir_tgt = os.path.join(host_outdir, vol.target[len(container_outdir)+1:])
115115
if os.path.islink(host_outdir_tgt) or os.path.isfile(host_outdir_tgt):
116116
os.remove(host_outdir_tgt)
117-
elif os.path.isdir(host_outdir_tgt):
117+
elif os.path.isdir(host_outdir_tgt) and not vol.resolved.startswith("_:"):
118118
shutil.rmtree(host_outdir_tgt)
119119
if onWindows():
120120
if vol.type in ("File", "WritableFile"):
121121
shutil.copy(vol.resolved, host_outdir_tgt)
122122
elif vol.type in ("Directory", "WritableDirectory"):
123123
copytree_with_merge(vol.resolved, host_outdir_tgt)
124-
else:
124+
elif not vol.resolved.startswith("_:"):
125125
os.symlink(vol.resolved, host_outdir_tgt)
126126

127127
class JobBase(object):

0 commit comments

Comments
 (0)