dctlenv/libexec/dctlenv-version

13 lines
307 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
set -uo pipefail
2021-06-23 13:14:49 +00:00
version="0.1.6"
git_revision=""
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q dctlenv; then
git_revision="$(git describe --tags HEAD 2>/dev/null || true)"
git_revision="${git_revision#v}"
fi
echo "dctlenv ${git_revision:-$version}"