From 0d2aa0a679effefc04fc1a9f8e307bc5fd1ca9af Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Sun, 25 May 2025 23:49:31 +0200
Subject: [PATCH] update ios deploy script

---
 scripts/deploy-ios.sh | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/scripts/deploy-ios.sh b/scripts/deploy-ios.sh
index 5a38a13..48dd530 100755
--- a/scripts/deploy-ios.sh
+++ b/scripts/deploy-ios.sh
@@ -2,6 +2,15 @@
 
 set -e
 
+# Function to clean up Info.plist
+cleanup() {
+    echo "Cleaning up Info.plist..."
+    git checkout ios/Runner/Info.plist
+}
+
+# Trap ERR and EXIT signals to ensure cleanup
+trap cleanup ERR EXIT
+
 # Load environment variables
 if [ -f .env ]; then
     export $(cat .env | sed 's/#.*//g' | xargs)
@@ -17,6 +26,11 @@ BUILD=$(awk -F '+' '{ print $2 }' <<<$fVersion)
 
 echo "Building Gecko iOS v${VERSION}+${BUILD}"
 
+# Temporarily replace build name and number in Info.plist
+echo "Updating Info.plist with version ${VERSION} and build number ${BUILD}"
+sed -i '' "s|\$(FLUTTER_BUILD_NAME)|${VERSION}|g" ios/Runner/Info.plist
+sed -i '' "s|\$(FLUTTER_BUILD_NUMBER)|${BUILD}|g" ios/Runner/Info.plist
+
 # get dependencies
 fvm flutter pub get
 
@@ -41,9 +55,7 @@ xcrun altool --upload-app \
     --file "$IPA_PATH" \
     --username "$APPLE_ID" \
     --password "$APP_SPECIFIC_PASSWORD" \
-    --bundle-id "$BUNDLE_ID" \
-    --bundle-version "$VERSION" \
-    --bundle-short-version-string "$BUILD"
+    --bundle-id "$BUNDLE_ID"
 
 if [ $? -eq 0 ]; then
     echo "Successfully uploaded to App Store"
@@ -52,4 +64,4 @@ else
     exit 1
 fi
 
-exit 0 
\ No newline at end of file
+exit 0
-- 
GitLab