Skip to content

Commit 5c7736f

Browse files
committed
CLI --tmp-dir now parents rbc scratch too, not just niwrap data_dir
1 parent 6bcf230 commit 5c7736f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/rbc/core/niwrap.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@ def setup_runner(
158158
"'auto', 'local', 'docker', 'podman', or 'singularity'"
159159
)
160160

161-
styx_runner = niwrap.get_global_runner()
161+
# A --tmp-dir passed on the CLI should parent both niwrap's data_dir
162+
# and rbc's scratch, so downstream generate_exec_folder calls honor
163+
# the caller's choice too.
162164
if tmp_dir is not None:
163-
Path(tmp_dir).mkdir(parents=True, exist_ok=True)
164-
data_parent = Path(tmp_dir)
165-
else:
166-
data_parent = _work_root() / "niwrap"
167-
data_parent.mkdir(parents=True, exist_ok=True)
165+
global _WORK_ROOT
166+
_WORK_ROOT = Path(tmp_dir)
167+
_WORK_ROOT.mkdir(parents=True, exist_ok=True)
168+
169+
styx_runner = niwrap.get_global_runner()
170+
data_parent = _work_root() / "niwrap"
171+
data_parent.mkdir(parents=True, exist_ok=True)
168172
styx_runner.data_dir = Path(tempfile.mkdtemp(dir=data_parent))
169173
styx_logger = logging.getLogger(styx_runner.logger_name)
170174
log_level = min(verbose, len(_LOG_LEVELS) - 1)

0 commit comments

Comments
 (0)