Created
February 28, 2026 17:50
-
-
Save cb341/3b27b418bf5f4dc2f5ec11d19a215fc4 to your computer and use it in GitHub Desktop.
Clean Ruby on Rails cluttered disk
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 | |
| if [[ ! -n "$ANGRY" ]] | |
| then | |
| echo "ANGRY flag not set, skipping.." | |
| exit 1 | |
| fi | |
| echo "CLEANING" | |
| find . -type d -name 'node_modules' -prune -exec du -sh {} \; -exec echo 'removing' {} \; -exec rm -rf {} \; & | |
| find . -name 'development.log' -exec du -sh {} \; -exec rm {} \; & | |
| find . -name 'test.log' -exec du -sh {} \; -exec rm {} \; & | |
| find . -type d -path '*/tmp/cache/bootsnap' -prune -exec du -sh {} \; -exec echo 'removing' {} \; -exec rm -rf {} \; & | |
| find . -type d -path '*/tmp/capybara' -prune -exec du -sh {} \; -exec echo 'removing' {} \; -exec rm -rf {} \; & | |
| echo "ALL CLEAN ^^" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On the workspace directory I cleaned up a couple hundred gigabites, not that interesting on personal however: