Delete all files created by this script.
(context)
| 622 | |
| 623 | |
| 624 | def clean_contents(context): |
| 625 | """Delete all files created by this script.""" |
| 626 | if context.target in {"all", "build"}: |
| 627 | build_dir = context.build_paths["native_build_dir"] |
| 628 | if build_dir.exists(): |
| 629 | print(f"🧹 Deleting {build_dir} ...") |
| 630 | shutil.rmtree(build_dir) |
| 631 | |
| 632 | if context.target in {"all", "host"}: |
| 633 | host_triple_dir = context.build_paths["host_triple_dir"] |
| 634 | if host_triple_dir.exists(): |
| 635 | print(f"🧹 Deleting {host_triple_dir} ...") |
| 636 | shutil.rmtree(host_triple_dir) |
| 637 | |
| 638 | if LOCAL_SETUP.exists(): |
| 639 | with LOCAL_SETUP.open("rb") as file: |
| 640 | if file.read(len(LOCAL_SETUP_MARKER)) == LOCAL_SETUP_MARKER: |
| 641 | print(f"🧹 Deleting generated {LOCAL_SETUP} ...") |
| 642 | |
| 643 | |
| 644 | def add_cross_build_dir_option(subcommand): |