From 8406a2bc7faa4649e6f3231da45f8344a8c6f21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 30 Sep 2022 12:29:49 +0200 Subject: [PATCH] Test for executables but not functions --- libexec/rbenv | 2 +- libexec/rbenv-help | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rbenv b/libexec/rbenv index 551e6440..8e4a1e01 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -44,7 +44,7 @@ shopt -s nullglob rbenv_bin="${BASH_SOURCE:-$0}" if [ -L "$rbenv_bin" ]; then # 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)" if [[ $resolved == /* ]]; then libexec_dir="${resolved%/*}" diff --git a/libexec/rbenv-help b/libexec/rbenv-help index e7a45dfa..481ea345 100755 --- a/libexec/rbenv-help +++ b/libexec/rbenv-help @@ -43,7 +43,7 @@ extract_initial_comment_block() { collect_documentation() { 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 echo "rbenv: cannot find awk" >&2 return 1 @@ -154,7 +154,7 @@ if [ "$1" = "--usage" ]; then fi 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 fi echo "Usage: rbenv []"