mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 23:33:45 -05:00
Ignore shell builtins and functions when looking up commands in PATH
Weirdly, `command -v true` returns `true` instead of `/usr/bin/true`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user