Sfoglia il codice sorgente

Display version origin with non-installed versions

This is useful as an indicator where it is coming from.
pull/487/head^2
Daniel Hahler 11 anni fa
parent
commit
e3982fae38
5 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +1
    -1
      libexec/rbenv-version-name
  2. +1
    -1
      libexec/rbenv-which
  3. +1
    -1
      test/exec.bats
  4. +1
    -1
      test/version-name.bats
  5. +1
    -1
      test/which.bats

+ 1
- 1
libexec/rbenv-version-name Vedi File

@ -23,6 +23,6 @@ if version_exists "$RBENV_VERSION"; then
elif version_exists "${RBENV_VERSION#ruby-}"; then elif version_exists "${RBENV_VERSION#ruby-}"; then
echo "${RBENV_VERSION#ruby-}" echo "${RBENV_VERSION#ruby-}"
else else
echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2
echo "rbenv: version \`$RBENV_VERSION' is not installed (set by $(rbenv-version-origin))" >&2
exit 1 exit 1
fi fi

+ 1
- 1
libexec/rbenv-which Vedi File

@ -52,7 +52,7 @@ done
if [ -x "$RBENV_COMMAND_PATH" ]; then if [ -x "$RBENV_COMMAND_PATH" ]; then
echo "$RBENV_COMMAND_PATH" echo "$RBENV_COMMAND_PATH"
elif ! [ -d "${RBENV_ROOT}/versions/${RBENV_VERSION}" ]; then elif ! [ -d "${RBENV_ROOT}/versions/${RBENV_VERSION}" ]; then
echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2
echo "rbenv: version \`$RBENV_VERSION' is not installed (set by $(rbenv-version-origin))" >&2
exit 1 exit 1
else else
echo "rbenv: $RBENV_COMMAND: command not found" >&2 echo "rbenv: $RBENV_COMMAND: command not found" >&2

+ 1
- 1
test/exec.bats Vedi File

@ -17,7 +17,7 @@ create_executable() {
@test "fails with invalid version" { @test "fails with invalid version" {
export RBENV_VERSION="2.0" export RBENV_VERSION="2.0"
run rbenv-exec ruby -v run rbenv-exec ruby -v
assert_failure "rbenv: version \`2.0' is not installed"
assert_failure "rbenv: version \`2.0' is not installed (set by RBENV_VERSION environment variable)"
} }
@test "completes with names of executables" { @test "completes with names of executables" {

+ 1
- 1
test/version-name.bats Vedi File

@ -49,7 +49,7 @@ setup() {
@test "missing version" { @test "missing version" {
RBENV_VERSION=1.2 run rbenv-version-name RBENV_VERSION=1.2 run rbenv-version-name
assert_failure "rbenv: version \`1.2' is not installed"
assert_failure "rbenv: version \`1.2' is not installed (set by RBENV_VERSION environment variable)"
} }
@test "version with prefix in name" { @test "version with prefix in name" {

+ 1
- 1
test/which.bats Vedi File

@ -59,7 +59,7 @@ create_executable() {
@test "version not installed" { @test "version not installed" {
create_executable "2.0" "rspec" create_executable "2.0" "rspec"
RBENV_VERSION=1.9 run rbenv-which rspec RBENV_VERSION=1.9 run rbenv-which rspec
assert_failure "rbenv: version \`1.9' is not installed"
assert_failure "rbenv: version \`1.9' is not installed (set by RBENV_VERSION environment variable)"
} }
@test "no executable found" { @test "no executable found" {

Caricamento…
Annulla
Salva