Skip to content

Commit 79789f0

Browse files
committed
Change log path.
1 parent 1cbea15 commit 79789f0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/pytask_stata/collect.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def run_stata_script(
3131
_executable: str,
3232
_script: Path,
3333
_options: list[str],
34-
_log_name: list[str],
34+
_log_name: str,
3535
_cwd: Path,
3636
) -> None:
3737
"""Run an R script."""
38-
cmd = [_executable, "-e", "do", _script.as_posix(), *_options, *_log_name]
38+
cmd = [_executable, "-e", "do", _script.as_posix(), *_options, _log_name]
3939
print("Executing " + " ".join(cmd) + ".") # noqa: T201
4040
subprocess.run(cmd, cwd=_cwd, check=True) # noqa: S603
4141

@@ -165,9 +165,9 @@ def pytask_collect_task(
165165
# Add log_name node that depends on the task id.
166166
if session.config["platform"] == "win32":
167167
log_name = convert_task_id_to_name_of_log_file(task)
168-
log_name_arg = [f"-{log_name}"]
168+
log_name_arg = f"-{log_name}"
169169
else:
170-
log_name_arg = []
170+
log_name_arg = ""
171171

172172
log_name_node = session.hook.pytask_collect_node(
173173
session=session,

src/pytask_stata/execute.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pytask import hookimpl
1313

1414
from pytask_stata.shared import STATA_COMMANDS
15-
from pytask_stata.shared import convert_task_id_to_name_of_log_file
1615

1716

1817
@hookimpl
@@ -41,7 +40,7 @@ def pytask_execute_task_teardown(session: Session, task: PTask) -> None:
4140
"""
4241
if has_mark(task, "stata"):
4342
if session.config["platform"] == "win32":
44-
log_name = convert_task_id_to_name_of_log_file(task)
43+
log_name = task.depends_on["_log_name"]
4544
if isinstance(task, PTaskWithPath):
4645
path_to_log = task.path.with_name(log_name).with_suffix(".log")
4746
else:

0 commit comments

Comments
 (0)