Skip to content

Commit

Permalink
snap: Fix detecting git commit version when a release version
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Jan 16, 2022
1 parent 2d285a6 commit 387fdf0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ parts:
- --disable-systemd
override-build: |
snapcraftctl build
VER=
if [ -f lib/git-commit.h ]; then
VER=$(grep GIT_COMMIT lib/git-commit.h | cut -d'"' -f2)
else
VER=
COMMIT=`grep GIT_COMMIT lib/git-commit.h | wc -l || true`
if [ $COMMIT -eq 1 ]; then
VER=$(grep GIT_COMMIT lib/git-commit.h | cut -d'"' -f2)
fi
fi
if [ -z $VER ]; then
VER=`grep "^AC_INIT" configure.ac | tr '[' ']' | cut -d']' -f4`
Expand Down

0 comments on commit 387fdf0

Please sign in to comment.