~strahinja/table

a8f78ceb6381c49919ea5e1addf16e0977510580 — Страхиња Радић 4 months ago 331a871 v0.7.11
lib/make{date,version}: Make the version use current commit if ahead of tag
2 files changed, 10 insertions(+), 8 deletions(-)

M lib/makedate
M lib/makeversion
M lib/makedate => lib/makedate +1 -1
@@ 5,7 5,7 @@ LC_ALL=C
export LC_ALL

if [ -d .got ] && command -v got >/dev/null 2>&1; then
	got tag -l |
	got log |
	awk '
	/^date: / {
		sub(/^date: /,"",$0)

M lib/makeversion => lib/makeversion +9 -7
@@ 3,13 3,15 @@
FALLBACKVER=${FALLBACKVER:-unknown}

if [ -d .got ] && command -v got >/dev/null 2>&1; then
	got tag -l |
	awk '
	/^tag/ {
		sub(/^v/,"",$2)
		print $2
		exit
	}' >version.new
	lastcommit=$(got log | awk '/^commit/ {print substr($2,1,9); exit}')
	lasttagcom=$(got tag -l |
		awk '/^object: commit/ { print substr($3,1,9); exit}')
	ver=$(got tag -l |
		awk '/^tag/ { sub(/^v/,"",$2); print $2; exit }')
	if [ "$lastcommit" != "$lasttagcom" ]; then
		ver="${ver}-$lastcommit"
	fi
	printf "%s\n" "$ver" >version.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
	LC_ALL=C
	export LC_ALL