From db5157c396a282af4d54bffeb304ea1920a95b4f Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 3 Oct 2024 07:44:08 +0200 Subject: [PATCH] Add --clean flag to pod-install.sh --- scripts/pod-install.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/pod-install.sh b/scripts/pod-install.sh index 506f36426f74..ebb7c6ca8342 100755 --- a/scripts/pod-install.sh +++ b/scripts/pod-install.sh @@ -15,11 +15,22 @@ cd "$ROOT_DIR" || exit 1 # See if we're in the HybridApp repo IS_HYBRID_APP_REPO=$(scripts/is-hybrid-app-repo.sh) +NEW_DOT_FLAG="false" +SHOULD_CLEAN="false" + +for arg in "$@"; do + if [ "$arg" == "--clean" ]; then + SHOULD_CLEAN="true" + elif [ "$arg" == "--new-dot" ]; then + NEW_DOT_FLAG="true" + fi +done + -if [[ "$IS_HYBRID_APP_REPO" == "true" && "$1" != "--new-dot" ]]; then +if [[ "$IS_HYBRID_APP_REPO" == "true" && "$NEW_DOT_FLAG" == "false" ]]; then cd ../ios - if [ "$1" == "--clean" ]; then - bundle exec pod deintegrate + if [ "$SHOULD_CLEAN" == "true" ]; then + bundle exec pod deintegrate fi # Navigate to the OldDot repository, and run pod install bundle exec pod install @@ -96,6 +107,9 @@ if [ -d "$CACHED_PODSPEC_DIR" ]; then fi cd ios || cleanupAndExit 1 +if [ "$SHOULD_CLEAN" == "true" ]; then + bundle exec pod deintegrate +fi bundle exec pod install # Go back to where we started