Created
April 26, 2017 13:04
-
-
Save alioguzhan/4cf07136a0c5a0e0a87941827efa55bd to your computer and use it in GitHub Desktop.
React-Native Cleaner Script
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 | |
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