Last active
December 29, 2022 10:03
-
-
Save serg-kovalev/11ff4e01d8b384711ec449eb947c2cae to your computer and use it in GitHub Desktop.
Remove all node_module folders in target folder
This file contains hidden or 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 | |
set -ueo pipefail | |
usage_example="USAGE:\n\tExample: ./remove_node_modules ~/your-dev-folder" | |
if [ $# -lt 1 ] | |
then | |
echo -e $usage_example | |
exit 1 | |
fi | |
folder=$1 | |
shift 1 | |
find $folder -type d -name "node_modules" -print0 | while read -d $'\0' $finding | |
do | |
rm -r $finding | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment