From 314e7c10e75136ce557fb367b0ef0fb4c47ec9f9 Mon Sep 17 00:00:00 2001 From: Patryk Klatka Date: Wed, 17 Apr 2024 10:39:34 +0200 Subject: [PATCH] Scripts: minor fixes (#186) --- packages/turbo/scripts/build-turbo-android.sh | 10 ++++------ packages/turbo/scripts/build-turbo-ios.sh | 10 ++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/turbo/scripts/build-turbo-android.sh b/packages/turbo/scripts/build-turbo-android.sh index b91c6938..c1282fff 100755 --- a/packages/turbo/scripts/build-turbo-android.sh +++ b/packages/turbo/scripts/build-turbo-android.sh @@ -13,8 +13,6 @@ if [ -z "$TURBO_ANDROID_VERSION" ] exit 1 fi -echo "turbo-android version: $TURBO_ANDROID_VERSION" - cd $TURBO_ANDROID_DIR rm -rf vendor mkdir vendor @@ -27,13 +25,13 @@ git clone --branch $TURBO_ANDROID_VERSION --depth 1 $TURBO_ANDROID_REPO_PATH cd turbo-android git apply $PATCH_FILE -# Build turbo-android to local maven repository +# Publish turbo-android to local maven repository ./gradlew -PVersion=local publishToMavenLocal -# Build turbo-android to vendor directory +# Publish turbo-android to vendor directory ./gradlew -Dmaven.repo.local=$TURBO_ANDROID_DIR/vendor -PVersion=local publishToMavenLocal -# Get necessary dependencies from turbo build.gradle +# Get necessary dependencies from turbo-android build.gradle file ./gradlew turbo:dependencies --configuration implementation > deps.txt ./gradlew turbo:dependencies --configuration api > apis.txt @@ -41,6 +39,7 @@ git apply $PATCH_FILE cd .. rm -rf $DEPENDENCIES_GRADLE_FILE touch $DEPENDENCIES_GRADLE_FILE + echo "ext {\n\tdeps = [ " > $DEPENDENCIES_GRADLE_FILE grep -oE $DEPENDENCY_REGEX ./turbo-android/deps.txt | awk '{print "\t\tdep" NR ": " "\""$1"\"" ","}' >> $DEPENDENCIES_GRADLE_FILE echo "\t]\n\tapis = [" >> $DEPENDENCIES_GRADLE_FILE @@ -49,4 +48,3 @@ echo "\t] \n}" >> $DEPENDENCIES_GRADLE_FILE # Cleanup rm -rf turbo-android - diff --git a/packages/turbo/scripts/build-turbo-ios.sh b/packages/turbo/scripts/build-turbo-ios.sh index 55688f77..6bb5f867 100644 --- a/packages/turbo/scripts/build-turbo-ios.sh +++ b/packages/turbo/scripts/build-turbo-ios.sh @@ -1,8 +1,6 @@ TURBO_IOS_REPO_PATH="https://github.com/hotwired/turbo-ios.git" TURBO_IOS_VERSION=$1 -shopt -s extglob - # First argument is the version tag if [ -z "$TURBO_IOS_VERSION" ] then @@ -19,6 +17,10 @@ mkdir vendor cd vendor git clone --branch $TURBO_IOS_VERSION --depth 1 $TURBO_IOS_REPO_PATH -# Remove all files except Source directory +# Keep the Source folder and remove the rest cd turbo-ios -rm -rf !(Source) +for file in *; do + if [ "$file" != "Source" ]; then + rm -rf $file + fi +done