This script should be run from the directory containing the node_modules directory and yarn.lock file you want to delete. Be careful with this script as it will delete these items without asking for confirmation. If you want a confirmation prompt before deletion, you can modify the rm commands to rm -i to ask for confirmation before each deletion.
Here's how to use the script:
- Save the script to a file, for example
cleanup.sh. - Make the script executable by running
chmod +x cleanup.shin your terminal. - Run the script using
./cleanup.shin your terminal.