13 lines
307 B
Plaintext
13 lines
307 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
set -uo pipefail
|
||
|
|
||
|
version="0.0.2"
|
||
|
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}"
|