Created
September 13, 2022 16:39
-
-
Save inigomarquinez/acb5a78c8349cd08f98e8d5624525399 to your computer and use it in GitHub Desktop.
Remove node_modules folders recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
CWD=$(pwd) | |
echo -e "Are you sure you want to remove all your node_modules folders recursively from here? (Press CTRL+C to cancel)" | |
echo -e "Current location: \e[32m$CWD\e[39m" | |
echo -n "Only 'yes' will be accepted to continue: " | |
read NEW_VALUE | |
if [ "$NEW_VALUE" = "yes" ]; then | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + | |
else | |
echo -e "Canceled!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment