mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Silence errors when piping type | head -1
This commit is contained in:
parent
d38d18ec25
commit
af454a32dc
4 changed files with 10 additions and 8 deletions
|
@ -28,7 +28,7 @@ if enable -f "${BASH_SOURCE%/*}"/../libexec/rbenv-realpath.dylib realpath 2>/dev
|
||||||
else
|
else
|
||||||
[ -z "$RBENV_NATIVE_EXT" ] || abort "failed to load \`realpath' builtin"
|
[ -z "$RBENV_NATIVE_EXT" ] || abort "failed to load \`realpath' builtin"
|
||||||
|
|
||||||
READLINK=$(type -p greadlink readlink | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -1)
|
||||||
[ -n "$READLINK" ] || abort "cannot find readlink - are you missing GNU coreutils?"
|
[ -n "$READLINK" ] || abort "cannot find readlink - are you missing GNU coreutils?"
|
||||||
|
|
||||||
resolve_link() {
|
resolve_link() {
|
||||||
|
|
|
@ -42,13 +42,15 @@ extract_initial_comment_block() {
|
||||||
}
|
}
|
||||||
|
|
||||||
collect_documentation() {
|
collect_documentation() {
|
||||||
local all_awks
|
local awk
|
||||||
local first_awk
|
awk="$(type -p gawk awk 2>/dev/null | head -1)"
|
||||||
all_awks=$(type -p gawk awk)
|
if [ -z "$awk" ]; then
|
||||||
first_awk=$(head -1 <<<"$all_awks")
|
echo "rbenv: cannot find awk" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
"$first_awk" '
|
"$awk" '
|
||||||
/^Summary:/ {
|
/^Summary:/ {
|
||||||
summary = substr($0, 10)
|
summary = substr($0, 10)
|
||||||
next
|
next
|
||||||
|
|
|
@ -26,7 +26,7 @@ if ! enable -f "${BASH_SOURCE%/*}"/rbenv-realpath.dylib realpath 2>/dev/null; th
|
||||||
echo "rbenv: failed to load \`realpath' builtin" >&2
|
echo "rbenv: failed to load \`realpath' builtin" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
READLINK=$(type -p greadlink readlink | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -1)
|
||||||
if [ -z "$READLINK" ]; then
|
if [ -z "$READLINK" ]; then
|
||||||
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -33,7 +33,7 @@ if ! enable -f "${BASH_SOURCE%/*}"/rbenv-realpath.dylib realpath 2>/dev/null; th
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
READLINK=$(type -p greadlink readlink | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -1)
|
||||||
if [ -z "$READLINK" ]; then
|
if [ -z "$READLINK" ]; then
|
||||||
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue