mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-04 20:35:34 -05:00
Merge pull request #1440 from rbenv/type-P
Test for executables but not functions
This commit is contained in:
commit
a6cf6aeadb
2 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ shopt -s nullglob
|
||||||
rbenv_bin="${BASH_SOURCE:-$0}"
|
rbenv_bin="${BASH_SOURCE:-$0}"
|
||||||
if [ -L "$rbenv_bin" ]; then
|
if [ -L "$rbenv_bin" ]; then
|
||||||
# resolve rbenv symlink to find out where the actual libexec directory is
|
# resolve rbenv symlink to find out where the actual libexec directory is
|
||||||
if readlink="$(type -p greadlink)" || readlink="$(type -p readlink)"; then
|
if readlink="$(type -P greadlink)" || readlink="$(type -P readlink)"; then
|
||||||
resolved="$("$readlink" "$rbenv_bin" 2>/dev/null)"
|
resolved="$("$readlink" "$rbenv_bin" 2>/dev/null)"
|
||||||
if [[ $resolved == /* ]]; then
|
if [[ $resolved == /* ]]; then
|
||||||
libexec_dir="${resolved%/*}"
|
libexec_dir="${resolved%/*}"
|
||||||
|
|
|
@ -43,7 +43,7 @@ extract_initial_comment_block() {
|
||||||
|
|
||||||
collect_documentation() {
|
collect_documentation() {
|
||||||
local awk
|
local awk
|
||||||
awk="$(type -p gawk awk 2>/dev/null | head -n1)"
|
awk="$(type -P gawk)" || awk="$(type -P awk)" || true
|
||||||
if [ -z "$awk" ]; then
|
if [ -z "$awk" ]; then
|
||||||
echo "rbenv: cannot find awk" >&2
|
echo "rbenv: cannot find awk" >&2
|
||||||
return 1
|
return 1
|
||||||
|
@ -154,7 +154,7 @@ if [ "$1" = "--usage" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ] || [ "$1" == "rbenv" ]; then
|
if [ -z "$1" ] || [ "$1" == "rbenv" ]; then
|
||||||
if [ -z "$usage" ] && [ -t 1 ] && type -p man >/dev/null; then
|
if [ -z "$usage" ] && [ -t 1 ] && type -P man >/dev/null; then
|
||||||
MANPATH="${BASH_SOURCE%/*}/../share/man:$MANPATH" exec man rbenv
|
MANPATH="${BASH_SOURCE%/*}/../share/man:$MANPATH" exec man rbenv
|
||||||
fi
|
fi
|
||||||
echo "Usage: rbenv <command> [<args>]"
|
echo "Usage: rbenv <command> [<args>]"
|
||||||
|
|
Loading…
Reference in a new issue