#!/bin/sh
set -eu

tag="$(git describe --tags --match 'v[0-9]*' --abbrev=7 --dirty 2>/dev/null || true)"

case "${tag}" in
	v*)
		printf '%s\n' "${tag#v}"
		;;
	"")
		printf 'dev\n'
		;;
	*)
		printf '%s\n' "${tag}"
		;;
esac
