Skip to content

Commit

Permalink
fix: remove python dependency for revision build script
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed May 2, 2024
1 parent 0d19282 commit 392dfc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export STM32F4XX ?= 1
# Set to 1 HYDRAFW_NFC to include HydraNFC extension support
export HYDRAFW_NFC ?= 1
export HYDRAFW_DEBUG ?= 0
export FW_REVISION := $(shell $(PYTHON) build-scripts/hydrafw-revision.py)
export FW_REVISION := $(shell build-scripts/hydrafw-revision)

HYDRAFW_OPTS =

Expand Down
14 changes: 14 additions & 0 deletions src/build-scripts/hydrafw-revision
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Get the version description from git
version=$(git describe --tags --always --dirty --long)

# Use regex to match version pattern v(x.x)
if [[ $version =~ v([0-9]+\.[0-9]+).* ]]
then
# If match found, print the version
echo ${BASH_REMATCH[1]}
else
# Print 0.0 if no match is found
echo "0.0"
fi
13 changes: 0 additions & 13 deletions src/build-scripts/hydrafw-revision.py

This file was deleted.

0 comments on commit 392dfc9

Please sign in to comment.