Created
February 5, 2021 13:36
-
-
Save ctreffs/c90be699c7e38063b17e07d59024b160 to your computer and use it in GitHub Desktop.
Get build number from git
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
#!/bin/sh | |
GIT=$1 | |
if [[ -z $GIT ]]; then | |
GIT=git | |
fi | |
# Use the commit count before HEAD as CFBundleVersion | |
head_date=`"${GIT}" show -s --format=%cI` | |
printf `"${GIT}" rev-list --all --before $head_date | wc -l | tr -d ' '` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment