Created
September 27, 2023 07:52
-
-
Save gearonix/1c2037e900b631beab1c62bbee71e4a2 to your computer and use it in GitHub Desktop.
Something like npkill, will delete all unnecessary files from your nodejs projects
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 | |
# will delete all unnecessary files | |
# from your nodejs projects | |
EXECUTE_DIR=$1 | |
PURPLE='\033[1;36m' | |
NC='\033[0m' | |
dirsToRemove=("node_modules" ".cache" "dist" ".next" "build" "tmp") | |
for dir in "${dirsToRemove[@]}" | |
do | |
echo -e "${PURPLE}removing folders:${NC} ${dir}" | |
find ${EXECUTE_DIR=$HOME/dsk} -name $dir -type d -prune -exec rm -rf {} \; | |
done | |
find . -name .git -type d -size +40M -exec rm -rf {} \; | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment