The script automates the process of cleaning up development-related directories, improving workspace organization and freeing up disk space. It supports the following features:
-
Directory Scanning:
- Scans a specified directory (or the current directory if no argument is provided) for
node_modules
andvendor
folders.
- Scans a specified directory (or the current directory if no argument is provided) for
-
Selective Deletion:
node_modules
: Removes allnode_modules
directories recursively within the specified path.
vendor
: Removesvendor
directories only if acomposer.json
file exists in the same level, ensuring it's part of a valid PHP project.