diff --git a/scripts/cleanup-repo.sh b/scripts/cleanup-repo.sh new file mode 100644 index 00000000..48e41acc --- /dev/null +++ b/scripts/cleanup-repo.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# ============================================================================= +# Cleanup Remote Repository - Remove Architecture-Level Files +# ============================================================================= +# This script removes files from git tracking that shouldn't be in the repo +# Files are removed from git but kept locally (needed for builds) +# ============================================================================= + +set -e + +echo "๐Ÿงน Cleaning up repository..." +echo "" + +# Remove frontend node_modules from git +echo "๐Ÿ“ฆ Removing frontend/node_modules/ from git tracking..." +git rm -r --cached frontend/node_modules/ 2>/dev/null || echo " (already removed or not tracked)" + +# Remove frontend dist from git +echo "๐Ÿ“ฆ Removing frontend/dist/ from git tracking..." +git rm -r --cached frontend/dist/ 2>/dev/null || echo " (already removed or not tracked)" + +# Remove all __pycache__ directories from git +echo "๐Ÿ Removing Python __pycache__/ directories from git tracking..." +git ls-files | grep "__pycache__" | xargs -r git rm --cached 2>/dev/null || echo " (already removed or not tracked)" + +# Remove .vite cache if tracked +echo "โšก Removing .vite/ cache from git tracking..." +git rm -r --cached frontend/.vite/ 2>/dev/null || echo " (not tracked)" +git ls-files | grep "\.vite" | xargs -r git rm --cached 2>/dev/null || echo " (already removed)" + +# Remove any .pyc files +echo "๐Ÿ Removing .pyc files from git tracking..." +git ls-files | grep "\.pyc$" | xargs -r git rm --cached 2>/dev/null || echo " (already removed)" + +# Remove any .pyo files +echo "๐Ÿ Removing .pyo files from git tracking..." +git ls-files | grep "\.pyo$" | xargs -r git rm --cached 2>/dev/null || echo " (already removed)" + +# Remove any .env files (shouldn't be in repo) +echo "๐Ÿ” Removing .env files from git tracking..." +git ls-files | grep "\.env$" | xargs -r git rm --cached 2>/dev/null || echo " (not tracked)" + +# Remove log files +echo "๐Ÿ“ Removing log files from git tracking..." +git ls-files | grep "\.log$" | xargs -r git rm --cached 2>/dev/null || echo " (not tracked)" + +echo "" +echo "โœ… Cleanup complete!" +echo "" +echo "๐Ÿ“Š Summary of changes:" +git status --short | head -20 +echo "" +echo "๐Ÿ’ก Next steps:" +echo " 1. Review the changes: git status" +echo " 2. Commit the cleanup: git commit -m 'chore: remove architecture-level files from repo'" +echo " 3. Push to remote: git push" +echo "" +echo "โš ๏ธ Note: Files are removed from git but kept locally (needed for builds)" +