Created
August 16, 2017 00:45
-
-
Save cbowns/8b55ebcfa5f669216ed486050e70ce1e to your computer and use it in GitHub Desktop.
Rename your iOS archives to include the app's version and build number
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
# Pardon the craziness: | |
# Given a directory of `*.xcarchive`s: | |
# enter your app's name for "<App name>", if you have a folder of | |
# heterogenous archives to process: | |
for dir (*); do | |
name=`defaults read "\`pwd\`"/$dir/Info.plist Name` | |
if [ "$name" = "<App name>" ]; | |
then | |
echo "$dir:" | |
name=`defaults read "\`pwd\`"/$dir/Info.plist Name` | |
version=`defaults read "\`pwd\`"/$dir/Info.plist ApplicationProperties | grep -i CFBundleShortVersionString | sed 's/;//g' | sed 's/.* =//g' | sed 's/"//g' | awk '{$1=$1};1'` | |
build=`defaults read "\`pwd\`"/$dir/Info.plist ApplicationProperties | grep -i CFBundleVersion | sed 's/;//g' | sed 's/.* =//g' | sed 's/"//g' | awk '{$1=$1};1'` | |
echo "moving to $name - $version - build $build - $dir" | |
mv $dir "$name - $version - build $build - $dir" | |
echo | |
else | |
echo 0 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment