dctlenv/libexec/dctlenv-version

13 lines
307 B
Bash
Executable File

#!/usr/bin/env bash
set -uo pipefail
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}"