Forked from beeva-manueldepaz/killAllNodeModules.sh
Last active
August 20, 2017 19:22
-
-
Save Pelirrojo/c880be25332fad0951e55a9ecfc77540 to your computer and use it in GitHub Desktop.
Script to clean all npm & bower current instalations in a folder 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/sh | |
# https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively | |
# $sudo mv /path/to/killAllNodeModules.sh /usr/local/bin/killAllNodeModules | |
# $sudo chmod a+x /usr/local/bin/killAllNodeModules | |
read -p "This will delete all node_modules & bower_componets in current and derived folders. Are you sure that you want to continue? (y/n) " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
find . -name "node_modules" -exec rm -rf '{}' + | |
find . -name "bower_components" -exec rm -rf '{}' + | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment