(app_name: str)
| 328 | return True |
| 329 | |
| 330 | def ensure_tmp_exists(app_name: str) -> bool: |
| 331 | try: |
| 332 | app_root = _get_app_root(app_name) |
| 333 | except ValueError as exc: |
| 334 | logger.exception("Error in ensure_tmp_exists: %s", exc) |
| 335 | return False |
| 336 | |
| 337 | if not app_root.is_dir(): |
| 338 | return False |
| 339 | |
| 340 | try: |
| 341 | tmp_agent_root = _get_tmp_agent_root(app_root, app_name) |
| 342 | except ValueError as exc: |
| 343 | logger.exception("Error in ensure_tmp_exists: %s", exc) |
| 344 | return False |
| 345 | |
| 346 | if tmp_agent_root.exists(): |
| 347 | return True |
| 348 | |
| 349 | try: |
| 350 | tmp_agent_root.mkdir(parents=True, exist_ok=True) |
| 351 | copy_dir_contents(app_root, tmp_agent_root) |
| 352 | except OSError as exc: |
| 353 | logger.exception("Error in ensure_tmp_exists: %s", exc) |
| 354 | return False |
| 355 | |
| 356 | return True |
| 357 | |
| 358 | @app.post( |
| 359 | "/dev/apps/{app_name}/builder/save", response_model_exclude_none=True |
nothing calls this directly
no test coverage detected