summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-03 19:02:14 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-03 19:02:14 +0100
commit977a0ce287b1c45c59f9f8d75d573695abcd3f2a (patch)
treeba217772826173a09d088569f6b7fda2f92a774c /py
parentb4bb3fdb9cfcb76fb5b64e0a031a70c807ac7395 (diff)
downloadmicropython-977a0ce287b1c45c59f9f8d75d573695abcd3f2a.tar.gz
micropython-977a0ce287b1c45c59f9f8d75d573695abcd3f2a.zip
py: Print tag/version/git describe in uPy banner.
Diffstat (limited to 'py')
-rwxr-xr-xpy/py-version.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/py-version.sh b/py/py-version.sh
index f574b574f4..53063381f5 100755
--- a/py/py-version.sh
+++ b/py/py-version.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+git_tag="$(git describe || echo unknown)"
git_hash="$(git rev-parse --short HEAD 2> /dev/null || echo unknown)"
git_files_are_clean=1
# Check if there are any modified files.
@@ -11,6 +12,7 @@ if [ "${git_files_are_clean}" != "1" ]; then
fi
cat <<EOF
// This file was generated by py/py-version.sh
+#define MICROPY_GIT_TAG "${git_tag}"
#define MICROPY_GIT_HASH "${git_hash}"
#define MICROPY_BUILD_DATE "$(date '+%Y-%m-%d')"
EOF