Last active
August 17, 2023 08:34
-
-
Save pavelglebov/05898726f13159a6f1b663b00b05f16c to your computer and use it in GitHub Desktop.
React Native refresh packages util script
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
CYAN='\033[0;36m' | |
NOCOLOR='\033[0m' | |
refresh_node_modules() { | |
echo -e "${CYAN}Refreshing node_modules${NOCOLOR}" | |
rm -rf ./node_modules && yarn install | |
} | |
refresh_ios() { | |
echo -e "${CYAN}Refreshing iOS packages${NOCOLOR}" | |
rm -rf ./ios/Pods | |
cd ios && pod install | |
} | |
refresh_android() { | |
echo -e "${CYAN}Refreshing Android packages${NOCOLOR}" | |
cd android && ./gradlew clean | |
} | |
refresh_watchman() { | |
watchman watch-del-all && watchman watch-del-all | |
} | |
refresh_all() { | |
refresh_node_modules | |
refresh_ios | |
cd .. | |
refresh_android | |
refresh_watchman | |
} | |
if [ "$1" = "ios" ]; then | |
refresh_node_modules | |
refresh_ios | |
refresh_watchman | |
exit 0 | |
elif [ "$1" = "android" ]; then | |
refresh_node_modules | |
refresh_android | |
refresh_watchman | |
exit 0 | |
elif [ "$1" = "npm" ]; then | |
refresh_node_modules | |
refresh_watchman | |
exit 0 | |
else | |
refresh_all | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment