Skip to content

Instantly share code, notes, and snippets.

@alioguzhan
Created April 26, 2017 13:04
Embed
What would you like to do?
React-Native Cleaner Script
#!/bin/bash
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Reset='\033[m'
echo -e "Cleaning ${Yellow}\$TMPDIR${Reset}..."
rm -fr $TMPDIR/react* ;
echo -e "${Green}Done."
echo -e "${Reset}Cleaning ${Yellow}watchman cache${Reset}...";
watchman watch-del-all
echo -e "${Green}Done."
echo -e "${Reset}Cleaning ${Yellow}npm cache${Reset}..."
npm cache clean;
echo -e "${Green}Done.${Reset}";
for i in "$@"
do
if [[ $i == "-hard" ]] ; then
echo -e "Removing ${Yellow}node_modules${Reset} folder..."
rm -rf node_modules;
echo -e "Re-Installing ${Yellow}node modules${Reset}..."
npm install
echo -e "${Green}Done.${Reset}";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment