From 664366da7e6e647322a791241fe3be8a609ebcaa Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Thu, 19 Jul 2018 13:22:26 +0200 Subject: [PATCH] fixes version option --- .version.sh | 9 +++++++++ meson.build | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .version.sh diff --git a/.version.sh b/.version.sh new file mode 100644 index 0000000..d8174ae --- /dev/null +++ b/.version.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +version=$(git describe --always --dirty 2> /dev/null | sed 's/^v//') + +if [ -n "$version" ] ; then + echo "$version" +else + echo "1.1.1" +fi diff --git a/meson.build b/meson.build index e9ee94b..c2c1bfd 100644 --- a/meson.build +++ b/meson.build @@ -1,8 +1,6 @@ -project( - 'archive-sum', - 'c', - version: run_command('git', 'describe', '--always', '--dirty').stdout().strip(), +project('archive-sum', 'c', license: ['MIT'], + version: run_command('sh', '.version.sh').stdout().strip(), default_options: ['c_std=gnu11'] )