Skip to content

Instantly share code, notes, and snippets.

@knud
Created February 18, 2020 21:16
Show Gist options
  • Save knud/337026c0dc8776d4eab6a536adfb1521 to your computer and use it in GitHub Desktop.
Save knud/337026c0dc8776d4eab6a536adfb1521 to your computer and use it in GitHub Desktop.
grab Git version number tag and parse
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