(context)
| 157 | def decorator(func): |
| 158 | @functools.wraps(func) |
| 159 | def wrapper(context): |
| 160 | working_dir = context.build_paths[path_key] |
| 161 | try: |
| 162 | tput_output = subprocess.check_output( |
| 163 | ["tput", "cols"], encoding="utf-8" |
| 164 | ) |
| 165 | terminal_width = int(tput_output.strip()) |
| 166 | except subprocess.CalledProcessError: |
| 167 | terminal_width = 80 |
| 168 | print("⎯" * terminal_width) |
| 169 | print("📁", working_dir) |
| 170 | if ( |
| 171 | clean_ok |
| 172 | and getattr(context, "clean", False) |
| 173 | and working_dir.exists() |
| 174 | ): |
| 175 | print("🚮 Deleting directory (--clean)...") |
| 176 | shutil.rmtree(working_dir) |
| 177 | |
| 178 | working_dir.mkdir(parents=True, exist_ok=True) |
| 179 | |
| 180 | with contextlib.chdir(working_dir): |
| 181 | return func(context, working_dir) |
| 182 | |
| 183 | return wrapper |
| 184 |
nothing calls this directly
no test coverage detected
searching dependent graphs…