Last active
October 21, 2021 07:39
-
-
Save badsyntax/f007888dcd31651c39d9a721c7e0b481 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Clear watchman watches | |
watchman watch-del-all 2>/dev/null | |
# Delete metro cache | |
rm -rf "${TMPDIR:-/tmp}"/metro-* | |
# local xcodebuild cache | |
cd ios/ | |
xcodebuild -alltargets clean 2>/dev/null | |
cd .. | |
# ensure all gradle daemons are stopped | |
cd android/ | |
./gradlew --stop | |
cd .. | |
# project deps | |
find . -name node_modules -type d -exec rm -rf {} \; 2>/dev/null | |
find . -name Pods -type d -exec rm -rf {} \; 2>/dev/null | |
# project build files | |
find . -name build -type d -exec rm -rf {} \; 2>/dev/null | |
# local gradle | |
find . -name .gradle -type d -exec rm -rf {} \; 2>/dev/null | |
find . -name .idea -type d -exec rm -rf {} \; 2>/dev/null | |
# global gradle cache | |
rm -rf "$HOME/.gradle/caches/" | |
# global xcodebuild cache | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" 2>/dev/null | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" 2>/dev/null | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* 2>/dev/null | |
echo | |
echo "!! All project build cache and built files have been deleted. !!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment