1
0
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:
Mislav Marohnić
2022-10-07 16:34:38 +02:00
parent 6b1cc34610
commit 43e30ef815
5 changed files with 5 additions and 5 deletions

View File

@@ -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