Lazily create the run dir for commands that need one. Cached on ctx.
(ctx: click.Context)
| 473 | |
| 474 | |
| 475 | def _ensure_run_dir(ctx: click.Context) -> str: |
| 476 | """Lazily create the run dir for commands that need one. Cached on ctx.""" |
| 477 | run_dir = ctx.obj.get("run_dir") |
| 478 | if run_dir is None: |
| 479 | run_dir = _attach_run_log(ctx.obj["log_level"]) |
| 480 | ctx.obj["run_dir"] = run_dir |
| 481 | return run_dir |
| 482 | |
| 483 | |
| 484 | # --------------------------------------------------------------------------- |
no test coverage detected