Created
February 18, 2020 21:16
-
-
Save knud/337026c0dc8776d4eab6a536adfb1521 to your computer and use it in GitHub Desktop.
grab Git version number tag and parse
This file contains 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
GIT_VERSION = $(shell git describe --tags --always) | |
DS_MAJOR = $(shell echo $(GIT_VERSION) | sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1/g') | |
DS_MINOR = $(shell echo $(GIT_VERSION) | sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\2/g') | |
DS_PATCH = $(shell echo $(GIT_VERSION) | sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\3/g') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment