Skip to content

Instantly share code, notes, and snippets.

@bsaqqa
Created July 12, 2021 07:44
Show Gist options
  • Save bsaqqa/7067b46803e3f360e32a7a0fa26d1403 to your computer and use it in GitHub Desktop.
Save bsaqqa/7067b46803e3f360e32a7a0fa26d1403 to your computer and use it in GitHub Desktop.
Remove `vendor` and `node_modules` folders from all folders of current directory
# Color
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
function red {
printf "${RED}$@${NC}\n"
}
function green {
printf "${GREEN}$@${NC}\n"
}
function yellow {
printf "${YELLOW}$@${NC}\n"
}
for d in $(find . -name vendor -maxdepth 2 -type d)
do
echo $(yellow " >> Removeing: ") $d
rm -rf $d
echo $(green " >> Removed: " ) $(green $d)
done # >output_file
for d in $(find . -name node_modules -maxdepth 2 -type d)
do
echo $(yellow " >> Removeing: ") $d
rm -rf $d
echo $(green " >> Removed: " ) $(green $d)
done # >output_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment