Skip to content

Instantly share code, notes, and snippets.

@designfrontier
Last active November 8, 2024 16:23
Show Gist options
  • Save designfrontier/b31baf5c9011d3a250f6d875197939ea to your computer and use it in GitHub Desktop.
Save designfrontier/b31baf5c9011d3a250f6d875197939ea to your computer and use it in GitHub Desktop.
archive and clean
#! /bin/bash
mv $1 ~/projects/Archive
# Loop over each first-level subdirectory
for dir in ~/projects/Archive/*/; do
# Check if 'node_modules' exists within the subdirectory
if [ -d "${dir}node_modules" ]; then
echo "Deleting ${dir}node_modules"
rm -rf "${dir}node_modules"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment