Tweak rbenv --version output

This commit is contained in:
Sam Stephenson 2012-12-13 11:22:06 -06:00
parent 3060578e3b
commit 1ebcbd92e2
2 changed files with 4 additions and 3 deletions

View file

@ -60,7 +60,7 @@ shopt -u nullglob
command="$1"
case "$command" in
"" | "-h" | "--help" )
echo -e "rbenv $(rbenv---version)\n$(rbenv-help)" >&2
echo -e "$(rbenv---version)\n$(rbenv-help)" >&2
;;
"-v" )
exec rbenv---version

View file

@ -2,9 +2,10 @@
set -e
[ -n "$RBENV_DEBUG" ] && set -x
version=v0.3.0
version=0.3.0
cd "$RBENV_ROOT"
git_revision="$(git describe --tags HEAD 2>/dev/null || true)"
git_revision="${git_revision#v}"
echo ${git_revision:-$version}
echo "rbenv ${git_revision:-$version}"