Created
May 24, 2019 05:33
-
-
Save whoislewys/18942ac40edb68460c709fe2ed74dee4 to your computer and use it in GitHub Desktop.
react-native-clean: get a clean build from a react-native project
This file contains 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
# Clean a react-native project | |
# usage: react-native-clean | |
# or: `react-native-clean deep` | |
# `deep` arg will clean yarn cache | |
function react-native-clean() { | |
echo "removing node modules..." | |
rm -rf node_modules | |
echo "clearing tmpdirs..." | |
rm -rf $TMPDIR/react-* | |
rm -rf $TMPDIR/npm-* | |
watchman watch-del-all | |
echo "removing ios & android build folders..." | |
rm -rf ios/build | |
rm -rf android/app/build | |
echo "reinstalling node modules" | |
yarn | |
echo "clearing yarn cache..." | |
echo "use ctrl+c to kill this server once it gives you the \"Done\" message" | |
yarn start --reset-cache | |
if [ "$1" = "deep" ]; then | |
yarn cache clean | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment