clean_examples.py 767 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. """Script to clean up the examples directory.
  3. This script helps developers maintain a clean development environment by removing
  4. the examples directory and its contents. This is useful when switching between
  5. different example apps or when wanting to start fresh.
  6. """
  7. import shutil
  8. from pathlib import Path
  9. def clean_examples():
  10. """Remove the examples directory and its contents."""
  11. examples_dir = Path(__file__).parent.parent / "examples"
  12. if examples_dir.exists():
  13. print(f"Removing examples directory at {examples_dir}")
  14. shutil.rmtree(examples_dir)
  15. print("Examples directory removed successfully.")
  16. else:
  17. print("No examples directory found.")
  18. if __name__ == "__main__":
  19. clean_examples()