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_modulesandvendorfolders.
- Scans a specified directory (or the current directory if no argument is provided) for
-
Selective Deletion:
node_modules: Removes allnode_modulesdirectories recursively within the specified path.
vendor: Removesvendordirectories only if acomposer.jsonfile exists in the same level, ensuring it's part of a valid PHP project.