Created
May 7, 2022 20:03
-
-
Save pzatorski/849d8559f631676d423bcdac737db595 to your computer and use it in GitHub Desktop.
Clean a React Native project (iOS)
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 | |
# exit when any command fails | |
set -e | |
COMMAND=$1 | |
function clean() { | |
printf "π§Ή Cleaning.. \n" | |
rm -rf ~/Library/Caches/CocoaPods Pods ~/Library/Developer/Xcode/DerivedData | |
rm -rf node_modules ios/build ios/Pods ios/Podfile.lock | |
yarn cache clean | |
printf "β Cleaning finished! \n" | |
} | |
function install_dependencies() { | |
printf "π¨βπ» Installing dependencies.. \n" | |
yarn | |
npx pod-install | |
printf "β All installed correctly" | |
} | |
function setup_environment() { | |
clean | |
install_dependencies | |
} | |
case $COMMAND in | |
clean) clean ;; | |
install) install_dependencies ;; | |
setup) setup_environment ;; | |
*) echo "β Command not found" ;; | |
esac |
Author
pzatorski
commented
May 7, 2022
- To clean your project
- To install dependencies
- To clean project and install dependencies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment