Skip to content

Instantly share code, notes, and snippets.

@vtourraine
Last active February 16, 2018 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtourraine/0f3ba2c1effeea238a7745758a4c147d to your computer and use it in GitHub Desktop.
Save vtourraine/0f3ba2c1effeea238a7745758a4c147d to your computer and use it in GitHub Desktop.
Run Script: Sync Version and Build Numbers
PLISTBUDDY="/usr/libexec/PlistBuddy"
MAIN_APP_PLIST_PATH="###/Info.plist"
EXTENSIONS_PLIST_PATHS=("###/Info.plist" "###/Info.plist")
BUNDLEVERSION=`${PLISTBUDDY} -c "Print :CFBundleVersion" "$MAIN_APP_PLIST_PATH"`
BUNDLEVERSIONSTRING=`${PLISTBUDDY} -c "Print :CFBundleShortVersionString" "$MAIN_APP_PLIST_PATH"`
for EXTENSIONS_PLIST_PATH in "${EXTENSIONS_PLIST_PATHS[@]}"
do
${PLISTBUDDY} -c "Set :CFBundleVersion $BUNDLEVERSION" "$EXTENSIONS_PLIST_PATH"
${PLISTBUDDY} -c "Set :CFBundleShortVersionString $BUNDLEVERSIONSTRING" "$EXTENSIONS_PLIST_PATH"
done
echo "Synced version and build numbers: ${BUNDLEVERSIONSTRING} (${BUNDLEVERSION})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment