Skip to content
This repository has been archived by the owner on Nov 10, 2019. It is now read-only.

Fix incrementing CFBundleVersion #119

Closed
macmule opened this issue Oct 16, 2018 · 1 comment
Closed

Fix incrementing CFBundleVersion #119

macmule opened this issue Oct 16, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@macmule
Copy link
Owner

macmule commented Oct 16, 2018

From:

#!/bin/bash

set -o errexit
set -o nounset

VERSION=$(git --git-dir="$PROJECT_DIR/.git" --work-tree="$PROJECT_DIR" log | grep '^commit' | wc -l)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSION" "$TARGET_BUILD_DIR/$INFOPLIST_PATH"

To:

#!/bin/bash
#
# https://crunchybagel.com/auto-incrementing-build-numbers-in-xcode/
# 

buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"

@macmule macmule added the bug label Oct 16, 2018
@macmule macmule added this to the 1.5.0 milestone Oct 16, 2018
@macmule macmule self-assigned this Oct 16, 2018
macmule added a commit that referenced this issue Oct 16, 2018
@macmule
Copy link
Owner Author

macmule commented Oct 16, 2018

In 1.5.0

@macmule macmule closed this as completed Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant