Commit 4d8319bd by Mislav Marohnić

Call `rbenv-*` subcommands directly, not through the `rbenv` executable

Benefits:
- makes it easier to stub `rbenv-*` subcommands in tests
- speeds up subcommands because it skips the main `rbenv` executable

Caveats:
- users are no longer able to call `bin/rbenv-install` or
  `rbenv-uninstall` directly
parent 501855c9
...@@ -94,7 +94,7 @@ unset VERSION_NAME ...@@ -94,7 +94,7 @@ unset VERSION_NAME
# version is specified by rbenv. Show usage instructions if a local # version is specified by rbenv. Show usage instructions if a local
# version is not specified. # version is not specified.
DEFINITION="${ARGUMENTS[0]}" DEFINITION="${ARGUMENTS[0]}"
[ -n "$DEFINITION" ] || DEFINITION="$(rbenv local 2>/dev/null || true)" [ -n "$DEFINITION" ] || DEFINITION="$(rbenv-local 2>/dev/null || true)"
[ -n "$DEFINITION" ] || usage 1 [ -n "$DEFINITION" ] || usage 1
...@@ -154,7 +154,7 @@ fi ...@@ -154,7 +154,7 @@ fi
# REE installer requires an existing Ruby installation to run. An # REE installer requires an existing Ruby installation to run. An
# unsatisfied local .ruby-version file can cause the installer to # unsatisfied local .ruby-version file can cause the installer to
# fail.) # fail.)
export RBENV_VERSION="$(rbenv global 2>/dev/null || true)" export RBENV_VERSION="$(rbenv-global 2>/dev/null || true)"
# Execute `before_install` hooks. # Execute `before_install` hooks.
...@@ -193,7 +193,7 @@ for hook in "${after_hooks[@]}"; do eval "$hook"; done ...@@ -193,7 +193,7 @@ for hook in "${after_hooks[@]}"; do eval "$hook"; done
# Run `rbenv-rehash` after a successful installation. # Run `rbenv-rehash` after a successful installation.
if [ "$STATUS" == "0" ]; then if [ "$STATUS" == "0" ]; then
rbenv rehash rbenv-rehash
else else
cleanup cleanup
fi fi
......
...@@ -76,7 +76,7 @@ for hook in "${before_hooks[@]}"; do eval "$hook"; done ...@@ -76,7 +76,7 @@ for hook in "${before_hooks[@]}"; do eval "$hook"; done
if [ -d "$PREFIX" ]; then if [ -d "$PREFIX" ]; then
rm -rf "$PREFIX" rm -rf "$PREFIX"
rbenv rehash rbenv-rehash
fi fi
for hook in "${after_hooks[@]}"; do eval "$hook"; done for hook in "${after_hooks[@]}"; do eval "$hook"; done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment