Quantcast
Channel: Recent Gists from badsyntax
Viewing all articles
Browse latest Browse all 31

clean.sh

$
0
0
clean.sh
#!/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. !!"

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>