Skip to content

Instantly share code, notes, and snippets.

@itod
Last active December 10, 2015 03:48
Show Gist options
  • Select an option

  • Save itod/4377147 to your computer and use it in GitHub Desktop.

Select an option

Save itod/4377147 to your computer and use it in GitHub Desktop.
Update CFBundleVersion
if [ $CONFIGURATION = "Debug" ]; then
exit 0;
fi
TARGET = "$PROJECT_DIR/res/conf/XXX-Info.plist"
echo $TARGET
if [ ! -f "$TARGET" ]; then
echo "missing file $TARGET"
exit 1;
fi
NEW_VERSION=`svnversion -n ./ | /usr/bin/perl -pe 's/(\d+:)?(\d+)[MS]*$/$2/eg'`
echo $NEW_VERSION;
/usr/libexec/PListBuddy -c "Set CFBundleVersion $NEW_VERSION" "$TARGET"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment