Skip to content

Commit f281ea7

Browse files
committed
tmp_outdir_prefix defaults to tmpdir_prefix
1 parent 55d9ad9 commit f281ea7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

cwltool/argparser.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,22 @@ def arg_parser() -> argparse.ArgumentParser:
112112
parser.add_argument(
113113
"--tmpdir-prefix",
114114
type=str,
115-
help="Path prefix for temporary directories",
115+
help="Path prefix for temporary directories. If --tmpdir-prefix is not "
116+
"provided, then the prefix for temporary directories is influenced by "
117+
"the value of the TMPDIR, TEMP, or TMP environment variables. Taking "
118+
"those into consideration, the current default is {}.".format(
119+
DEFAULT_TMP_PREFIX
120+
),
116121
default=DEFAULT_TMP_PREFIX,
117122
)
118123

119124
exgroup = parser.add_mutually_exclusive_group()
120125
exgroup.add_argument(
121126
"--tmp-outdir-prefix",
122127
type=str,
123-
help="Path prefix for intermediate output directories",
124-
default=DEFAULT_TMP_PREFIX,
128+
help="Path prefix for intermediate output directories. Defaults to the "
129+
"value of --tmpdir-prefix.",
130+
default="",
125131
)
126132

127133
exgroup.add_argument(

cwltool/context.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
9696
self.use_container = True # type: bool
9797
self.force_docker_pull = False # type: bool
9898

99-
self.tmp_outdir_prefix = DEFAULT_TMP_PREFIX # type: str
99+
self.tmp_outdir_prefix = "" # type: str
100100
self.tmpdir_prefix = DEFAULT_TMP_PREFIX # type: str
101101
self.tmpdir = "" # type: str
102102
self.rm_tmpdir = True # type: bool
@@ -149,6 +149,8 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
149149
self.default_stdout = None # type: Optional[Union[IO[bytes], TextIO]]
150150
self.default_stderr = None # type: Optional[Union[IO[bytes], TextIO]]
151151
super(RuntimeContext, self).__init__(kwargs)
152+
if self.tmp_outdir_prefix == "":
153+
self.tmp_outdir_prefix = self.tmpdir_prefix
152154

153155
def get_outdir(self) -> str:
154156
"""Return self.outdir or create one with self.tmp_outdir_prefix."""

0 commit comments

Comments
 (0)