Skip to content

Instantly share code, notes, and snippets.

@mahdi-malv
Created July 8, 2021 12:27
Show Gist options
  • Save mahdi-malv/550d5167c8a821a8be692378748301f1 to your computer and use it in GitHub Desktop.
Save mahdi-malv/550d5167c8a821a8be692378748301f1 to your computer and use it in GitHub Desktop.
Remove build directories of IntelliJ projects with python3
python3 -c """
import shutil
import glob
for i in glob.glob('**/build/',recursive=True):
print(f'Deleting {i}')
try:
shutil.rmtree(i)
except OSError:
print(f'Failed to remove {i}')
"""
# 1. For WINDOWS, replace `python3` with `python` or `py`
# 2. To remove directories other than `build` replace `/build` with that folder (such as node_modules)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment