Skip to content

Commit

Permalink
Add post-clone script to install correct cocoapods-version
Browse files Browse the repository at this point in the history
  • Loading branch information
rottabonus committed Feb 11, 2024
1 parent aa847e7 commit 63f46c6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions appcenter-post-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
CUR_COCOAPODS_VER=`sed -n -e 's/^COCOAPODS: \([0-9.]*\)/\1/p' ios/Podfile.lock`
ENV_COCOAPODS_VER=`pod --version`

# check if not the same version, reinstall cocoapods version to current project's
if [ $CUR_COCOAPODS_VER != $ENV_COCOAPODS_VER ];
then
echo "Uninstalling all CocoaPods versions"
sudo gem uninstall cocoapods --all --executables
echo "Installing CocoaPods version $CUR_COCOAPODS_VER"
sudo gem install cocoapods -v $CUR_COCOAPODS_VER
else
echo "CocoaPods version is suitable for the project"
fi;

0 comments on commit 63f46c6

Please sign in to comment.