Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added current values #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ if [ -z "${append_version}" ] ; then
exit 1
fi

# ---------------------
# --- Original values:
ORIGINAL_BUNDLE_VERSION="$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "${info_plist_file}")"
echo " (i) Original Bundle Version: $ORIGINAL_BUNDLE_VERSION"
ORIGINAL_BUNDLE_SHORT_VERSION="$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${info_plist_file}")"
echo " (i) Original Bundle Short Version String: $ORIGINAL_BUNDLE_SHORT_VERSION"

# We populate the APP_ORIGINAL_VERSION and APP_ORIGINAL_BUILD with the current values
envman add --key APP_ORIGINAL_VERSION --value "${ORIGINAL_BUNDLE_VERSION}"
envman add --key APP_ORIGINAL_BUILD --value "${ORIGINAL_BUNDLE_SHORT_VERSION}"

# ---------------------
# --- Configs:

Expand All @@ -53,17 +64,11 @@ if [ ! -z "${version_short_offset}" ] ; then
bundle_version_short=$((${bundle_version_short} + ${version_short_offset}))
fi

ORIGINAL_BUNDLE_VERSION="$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "${info_plist_file}")"
echo " (i) Original Bundle Version: $ORIGINAL_BUNDLE_VERSION"
ORIGINAL_BUNDLE_SHORT_VERSION="$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${info_plist_file}")"
echo " (i) Original Bundle Short Version String: $ORIGINAL_BUNDLE_SHORT_VERSION"

if [ "${append_version}" == "true" ]; then
echo " (i) Need append version"
bundle_version=${ORIGINAL_BUNDLE_VERSION}${bundle_version}
fi


/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${bundle_version}" "${info_plist_file}"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${bundle_version_short}" "${info_plist_file}"

Expand All @@ -75,4 +80,4 @@ echo " (i) Replaced Bundle Short Version String: $REPLACED_BUNDLE_SHORT_VERSION"
envman add --key APP_VERSION --value "${REPLACED_BUNDLE_VERSION}"
envman add --key APP_BUILD --value "${REPLACED_BUNDLE_SHORT_VERSION}"

# ==> Bundler version patched in Info.plist file for iOS project
# ==> Bundler version patched in Info.plist file for iOS project