Created
February 5, 2021 13:37
-
-
Save ctreffs/7d46dba61821a720a4d643cd4fb0a226 to your computer and use it in GitHub Desktop.
Get version string 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 last annotated 'develop' tag as CFBundleShortVersionString | |
version=`"${GIT}" tag --merged HEAD --list 'develop/*' --sort=v:refname | tail -n 1` | |
printf `echo $version | sed 's/\-[0-9]*\-[a-zA-Z0-9]*//' | sed 's/develop\///'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment