Skip to content

Commit 2a8af96

Browse files
authored
Fix tmpdir_prefix/tmp_outdir_prefix/cachedir on args -> runtimeContext (#796)
1 parent 24a3493 commit 2a8af96

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cwltool/main.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -521,20 +521,19 @@ def main(argsl=None, # type: List[str]
521521
# shared volumes in Docker for Mac
522522
# More info: https://dockstore.org/docs/faq
523523
if sys.platform == "darwin":
524-
tmp_prefix = "tmp_outdir_prefix"
525524
default_mac_path = "/private/tmp/docker_tmp"
526-
if getattr(args, tmp_prefix) and getattr(args, tmp_prefix) == DEFAULT_TMP_PREFIX:
527-
setattr(args, tmp_prefix, default_mac_path)
525+
if runtimeContext.tmp_outdir_prefix == DEFAULT_TMP_PREFIX:
526+
runtimeContext.tmp_outdir_prefix = default_mac_path
528527

529528
for dirprefix in ("tmpdir_prefix", "tmp_outdir_prefix", "cachedir"):
530-
if getattr(args, dirprefix) and getattr(args, dirprefix) != DEFAULT_TMP_PREFIX:
531-
sl = "/" if getattr(args, dirprefix).endswith("/") or dirprefix == "cachedir" \
529+
if getattr(runtimeContext, dirprefix) and getattr(runtimeContext, dirprefix) != DEFAULT_TMP_PREFIX:
530+
sl = "/" if getattr(runtimeContext, dirprefix).endswith("/") or dirprefix == "cachedir" \
532531
else ""
533-
setattr(args, dirprefix,
534-
os.path.abspath(getattr(args, dirprefix)) + sl)
535-
if not os.path.exists(os.path.dirname(getattr(args, dirprefix))):
532+
setattr(runtimeContext, dirprefix,
533+
os.path.abspath(getattr(runtimeContext, dirprefix)) + sl)
534+
if not os.path.exists(os.path.dirname(getattr(runtimeContext, dirprefix))):
536535
try:
537-
os.makedirs(os.path.dirname(getattr(args, dirprefix)))
536+
os.makedirs(os.path.dirname(getattr(runtimeContext, dirprefix)))
538537
except Exception as e:
539538
_logger.error("Failed to create directory: %s", e)
540539
return 1

0 commit comments

Comments
 (0)