From 0632325a438a3aef38e7f94e10308ee69b72ad97 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Mon, 12 Sep 2011 10:11:59 -0500 Subject: [PATCH] Set RBENV_DEBUG=1 to see what's going on under the hood --- libexec/rbenv | 1 + libexec/rbenv-commands | 1 + libexec/rbenv-exec | 1 + libexec/rbenv-global | 1 + libexec/rbenv-help | 1 + libexec/rbenv-init | 1 + libexec/rbenv-local | 1 + libexec/rbenv-prefix | 1 + libexec/rbenv-rehash | 1 + libexec/rbenv-sh-shell | 1 + libexec/rbenv-version | 1 + libexec/rbenv-version-file | 1 + libexec/rbenv-version-file-read | 1 + libexec/rbenv-version-file-write | 1 + libexec/rbenv-version-name | 1 + libexec/rbenv-version-origin | 1 + libexec/rbenv-versions | 1 + libexec/rbenv-whence | 1 + libexec/rbenv-which | 1 + 19 files changed, 19 insertions(+) diff --git a/libexec/rbenv b/libexec/rbenv index 275e122a..3c241d3e 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x resolve_link() { $(type -p greadlink readlink | head -1) $1 diff --git a/libexec/rbenv-commands b/libexec/rbenv-commands index 4b593b4b..94fa249e 100755 --- a/libexec/rbenv-commands +++ b/libexec/rbenv-commands @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x if [ "$1" = "--sh" ]; then sh=1 diff --git a/libexec/rbenv-exec b/libexec/rbenv-exec index 9d1a70af..6d6ad1eb 100755 --- a/libexec/rbenv-exec +++ b/libexec/rbenv-exec @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x RBENV_COMMAND="$1" if [ -z "$RBENV_COMMAND" ]; then diff --git a/libexec/rbenv-global b/libexec/rbenv-global index 134c26b9..4bffa7cf 100755 --- a/libexec/rbenv-global +++ b/libexec/rbenv-global @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x RBENV_VERSION="$1" RBENV_VERSION_FILE="${RBENV_ROOT}/global" diff --git a/libexec/rbenv-help b/libexec/rbenv-help index 36fcf26b..7d941360 100755 --- a/libexec/rbenv-help +++ b/libexec/rbenv-help @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x print_set_version() { echo " should be a string matching a Ruby version known by rbenv." diff --git a/libexec/rbenv-init b/libexec/rbenv-init index ffc30682..a83cee40 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x print="" if [ "$1" = "-" ]; then diff --git a/libexec/rbenv-local b/libexec/rbenv-local index 8b08a429..e8f1c96d 100755 --- a/libexec/rbenv-local +++ b/libexec/rbenv-local @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x RBENV_VERSION="$1" RBENV_VERSION_FILE=".rbenv-version" diff --git a/libexec/rbenv-prefix b/libexec/rbenv-prefix index c623a3e2..41df5323 100755 --- a/libexec/rbenv-prefix +++ b/libexec/rbenv-prefix @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x if [ -n "$1" ]; then RBENV_VERSION="$1" diff --git a/libexec/rbenv-rehash b/libexec/rbenv-rehash index a2fe17cf..10c5d1e8 100755 --- a/libexec/rbenv-rehash +++ b/libexec/rbenv-rehash @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x SHIM_PATH="${RBENV_ROOT}/shims" PROTOTYPE_SHIM_PATH="${SHIM_PATH}/.rbenv-shim" diff --git a/libexec/rbenv-sh-shell b/libexec/rbenv-sh-shell index d2c80904..dde85e11 100755 --- a/libexec/rbenv-sh-shell +++ b/libexec/rbenv-sh-shell @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x version="$1" diff --git a/libexec/rbenv-version b/libexec/rbenv-version index b3b2cdf0..7251a4c9 100755 --- a/libexec/rbenv-version +++ b/libexec/rbenv-version @@ -1,4 +1,5 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x echo "$(rbenv-version-name) (set by $(rbenv-version-origin))" diff --git a/libexec/rbenv-version-file b/libexec/rbenv-version-file index d175dd42..eb72ec38 100755 --- a/libexec/rbenv-version-file +++ b/libexec/rbenv-version-file @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x root="$(pwd)" while [ -n "$root" ]; do diff --git a/libexec/rbenv-version-file-read b/libexec/rbenv-version-file-read index bc79d13a..8d27b0f0 100755 --- a/libexec/rbenv-version-file-read +++ b/libexec/rbenv-version-file-read @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x VERSION_FILE="$1" diff --git a/libexec/rbenv-version-file-write b/libexec/rbenv-version-file-write index 0435cf14..7c0fc7db 100755 --- a/libexec/rbenv-version-file-write +++ b/libexec/rbenv-version-file-write @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x RBENV_VERSION_FILE="$1" RBENV_VERSION="$2" diff --git a/libexec/rbenv-version-name b/libexec/rbenv-version-name index 74f6de04..f65fa1d4 100755 --- a/libexec/rbenv-version-name +++ b/libexec/rbenv-version-name @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x if [ -z "$RBENV_VERSION" ]; then RBENV_VERSION_FILE="$(rbenv-version-file)" diff --git a/libexec/rbenv-version-origin b/libexec/rbenv-version-origin index 31653d49..9b029b0c 100755 --- a/libexec/rbenv-version-origin +++ b/libexec/rbenv-version-origin @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x if [ -n "$RBENV_VERSION" ]; then echo "RBENV_VERSION environment variable" diff --git a/libexec/rbenv-versions b/libexec/rbenv-versions index ac53ad11..2fb8fc07 100755 --- a/libexec/rbenv-versions +++ b/libexec/rbenv-versions @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x RBENV_VERSION_NAME="$(rbenv-version-name)" diff --git a/libexec/rbenv-whence b/libexec/rbenv-whence index 591ad6cd..f90b6c4e 100755 --- a/libexec/rbenv-whence +++ b/libexec/rbenv-whence @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x if [ "$1" = "--path" ]; then print_paths="1" diff --git a/libexec/rbenv-which b/libexec/rbenv-which index 32884ed9..233c3e4f 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +[ -n "$RBENV_DEBUG" ] && set -x expand_path() { if [ ! -d "$1" ]; then