Last active
August 29, 2015 14:10
-
-
Save slabko/ed5ab9bc5bd5485cf022 to your computer and use it in GitHub Desktop.
[Build] Check if there is more that one provisioning profile with the given name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROFILE_NAME='iOSTeam Provisioning Profile: Andrew Slabko' | |
ARRAY=() | |
DIR="/Users/slabko/Library/MobileDevice/Provisioning Profiles" | |
for f in "$DIR"/*.mobileprovision | |
do | |
NAME=`security cms -D -i "$f" > tmp.plist && /usr/libexec/PlistBuddy -c 'Print :Name' tmp.plist` | |
if [ "$NAME" = "$PROFILE_NAME" ]; then | |
echo "$f created `security cms -D -i "$f" > tmp.plist && /usr/libexec/PlistBuddy -c 'Print :CreationDate' tmp.plist`" | |
ARRAY+=("$f") | |
fi | |
done | |
if [ ${#ARRAY[@]} -gt 1 ]; then | |
echo "Found more than one profile" | |
exit 0 | |
fi | |
if [ ${#ARRAY[@]} -eq 0 ]; then | |
echo "No profiles found with the name $PROFILE_NAME" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment