Open ggrandou opened 2 months ago
This patch automates the version string in the firmware by using the most recent available git tag.
python script is automatically called by platformio upon build which appends a GIT_VERSION define to build flags.
version string is built from the output of git describe --tags --always --dirty command
git describe --tags --always --dirty
Some version examples:
GIT_VERSION is gracefully ignored when the build is not run inside a git repository or if git fails for whatever reason.
For safety I have kept the original code if GIT_VERSION is not defined, but it could make sense to have a generic "unknown" version string or similar.
It has been tested on a linux platform. It should work on windows as well, but it's untested.
This patch automates the version string in the firmware by using the most recent available git tag.
python script is automatically called by platformio upon build which appends a GIT_VERSION define to build flags.
version string is built from the output of
git describe --tags --always --dirty
commandSome version examples:
GIT_VERSION is gracefully ignored when the build is not run inside a git repository or if git fails for whatever reason.
For safety I have kept the original code if GIT_VERSION is not defined, but it could make sense to have a generic "unknown" version string or similar.
It has been tested on a linux platform. It should work on windows as well, but it's untested.