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.sh
in your terminal. - Run the script using
./cleanup.sh
in your terminal.
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.