mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-03 09:33:14 -05:00
Merge pull request #1332 from rbenv/head-flag
Supply `head -n` flag explicitly
This commit is contained in:
commit
b904ea54cc
5 changed files with 5 additions and 5 deletions
|
@ -29,7 +29,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 2>/dev/null | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -n1)
|
||||||
[ -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() {
|
||||||
|
|
|
@ -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 -1)"
|
awk="$(type -p gawk awk 2>/dev/null | head -n1)"
|
||||||
if [ -z "$awk" ]; then
|
if [ -z "$awk" ]; then
|
||||||
echo "rbenv: cannot find awk" >&2
|
echo "rbenv: cannot find awk" >&2
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -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 2>/dev/null | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -n1)
|
||||||
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 2>/dev/null | head -1)
|
READLINK=$(type -p greadlink readlink 2>/dev/null | head -n1)
|
||||||
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
|
||||||
|
|
|
@ -87,7 +87,7 @@ OUT
|
||||||
if [[ \$1 == "-S"* ]]; then
|
if [[ \$1 == "-S"* ]]; then
|
||||||
found="\$(PATH="\${RUBYPATH:-\$PATH}" which \$2)"
|
found="\$(PATH="\${RUBYPATH:-\$PATH}" which \$2)"
|
||||||
# assert that the found executable has ruby for shebang
|
# assert that the found executable has ruby for shebang
|
||||||
if head -1 "\$found" | grep ruby >/dev/null; then
|
if head -n1 "\$found" | grep ruby >/dev/null; then
|
||||||
\$BASH "\$found"
|
\$BASH "\$found"
|
||||||
else
|
else
|
||||||
echo "ruby: no Ruby script found in input (LoadError)" >&2
|
echo "ruby: no Ruby script found in input (LoadError)" >&2
|
||||||
|
|
Loading…
Reference in a new issue