From ec72420a8c48c6b8e0993c5389360c82c4fbbcb7 Mon Sep 17 00:00:00 2001 From: Evan Coleman <706048+evandcoleman@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:43:56 -0400 Subject: [PATCH] Fix for when firebase packages differently (#48) --- .scripts/package.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.scripts/package.sh b/.scripts/package.sh index a0f7359..44e23d9 100755 --- a/.scripts/package.sh +++ b/.scripts/package.sh @@ -370,8 +370,26 @@ if [[ $latest != $current || $debug ]]; then gh release download --pattern 'Firebase.zip' --repo $firebase_repo echo "Unzipping.." unzip -q Firebase.zip - echo "Preparing xcframeworks for distribution..." + # Sometimes Firebase packages frameworks in a folder named for the version + if [ ! -d "Firebase" ]; then + # Get version number with _ instead of . + fixed_version=$(echo $latest | sed 's/\./_/g') + + if [ -d "$fixed_version" ]; then + cd $fixed_version + # Find the first zip file in the current directory + zip_file=$(ls -1 | grep .zip | head -1) + echo "Unzipping $zip_file..." + unzip -q $zip_file + mv Firebase ../Firebase + cd .. + else + echo "Could not find Firebase folder." + exit 1 + fi + fi cd Firebase + echo "Preparing xcframeworks for distribution..." rename_frameworks "_" zip_frameworks echo "Creating distribution files..."