mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-18 00:03:45 -05:00
Silence errors when piping type | head -1
This commit is contained in:
@@ -42,13 +42,15 @@ extract_initial_comment_block() {
|
||||
}
|
||||
|
||||
collect_documentation() {
|
||||
local all_awks
|
||||
local first_awk
|
||||
all_awks=$(type -p gawk awk)
|
||||
first_awk=$(head -1 <<<"$all_awks")
|
||||
local awk
|
||||
awk="$(type -p gawk awk 2>/dev/null | head -1)"
|
||||
if [ -z "$awk" ]; then
|
||||
echo "rbenv: cannot find awk" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
"$first_awk" '
|
||||
"$awk" '
|
||||
/^Summary:/ {
|
||||
summary = substr($0, 10)
|
||||
next
|
||||
|
||||
Reference in New Issue
Block a user