diff --git a/libexec/rbenv b/libexec/rbenv index 8e4a1e01..e5ce0a9a 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -99,7 +99,7 @@ case "$command" in exec rbenv-help ;; * ) - command_path="$(command -v "rbenv-$command" || true)" + command_path="$(type -P "rbenv-$command" || true)" if [ -z "$command_path" ]; then if [ "$command" == "shell" ]; then abort "shell integration not enabled. Run \`rbenv init' for instructions." diff --git a/libexec/rbenv-completions b/libexec/rbenv-completions index a219b7b8..3ac21599 100755 --- a/libexec/rbenv-completions +++ b/libexec/rbenv-completions @@ -15,7 +15,7 @@ if [ "$COMMAND" = "--complete" ]; then exec rbenv-commands fi -COMMAND_PATH="$(command -v "rbenv-$COMMAND" || command -v "rbenv-sh-$COMMAND")" +COMMAND_PATH="$(type -P "rbenv-$COMMAND" "rbenv-sh-$COMMAND" | head -n1)" # --help is provided automatically echo --help diff --git a/libexec/rbenv-help b/libexec/rbenv-help index f7d26d4d..ef041525 100755 --- a/libexec/rbenv-help +++ b/libexec/rbenv-help @@ -23,7 +23,7 @@ fi command_path() { local command="$1" - command -v rbenv-"$command" || command -v rbenv-sh-"$command" || true + type -P rbenv-"$command" rbenv-sh-"$command" | head -n1 } extract_initial_comment_block() { diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 3d23f665..ff79b3db 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -47,7 +47,7 @@ root="${root%/*}" rbenv_in_path=true if [ -n "$RBENV_ORIG_PATH" ]; then - PATH="$RBENV_ORIG_PATH" command -v rbenv >/dev/null || rbenv_in_path="" + PATH="$RBENV_ORIG_PATH" type -P rbenv >/dev/null || rbenv_in_path="" fi if [ -z "$print" ]; then diff --git a/libexec/rbenv-rehash b/libexec/rbenv-rehash index dd2afe61..f819b829 100755 --- a/libexec/rbenv-rehash +++ b/libexec/rbenv-rehash @@ -38,7 +38,7 @@ remove_prototype_shim() { # absolute path to the rbenv executable itself. rbenv_path() { local found - found="$(PATH="$RBENV_ORIG_PATH" command -v rbenv)" + found="$(PATH="$RBENV_ORIG_PATH" type -P rbenv)" if [[ $found == /* ]]; then echo "$found" elif [[ -n "$found" ]]; then