Wipe the contents of the sandbox directory.
()
| 30 | |
| 31 | |
| 32 | def wipe_sandbox_directory(): |
| 33 | """Wipe the contents of the sandbox directory.""" |
| 34 | sandbox_dir = Path("dev/sandbox") |
| 35 | |
| 36 | if not sandbox_dir.exists(): |
| 37 | sandbox_dir.mkdir(parents=True, exist_ok=True) |
| 38 | print(f"✓ Created sandbox directory at {sandbox_dir}") |
| 39 | return True |
| 40 | |
| 41 | try: |
| 42 | # Remove all contents of the sandbox directory |
| 43 | for item in sandbox_dir.iterdir(): |
| 44 | if item.is_file(): |
| 45 | item.unlink() |
| 46 | elif item.is_dir(): |
| 47 | shutil.rmtree(item) |
| 48 | |
| 49 | print("✓ Wiped contents of sandbox directory") |
| 50 | return True |
| 51 | except Exception as e: |
| 52 | print(f"Error wiping sandbox directory: {e}") |
| 53 | return False |
| 54 | |
| 55 | |
| 56 | def get_task_config(task_name): |