mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
bail out early if readlink is not available
readlink comes from GNU coreutils. On systems without it, rbenv used to spin out of control when it didn't have readlink or greadlink available because it would re-exec the frontend script over and over instead of the worker script in libexec. Fixes #389
This commit is contained in:
parent
e93ab45dc3
commit
81bb14e181
3 changed files with 21 additions and 3 deletions
|
@ -12,8 +12,14 @@ if [ -n "$RBENV_DEBUG" ]; then
|
|||
set -x
|
||||
fi
|
||||
|
||||
READLINK=$(type -p greadlink readlink | head -1)
|
||||
if [ -z "$READLINK" ]; then
|
||||
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
resolve_link() {
|
||||
$(type -p greadlink readlink | head -1) "$1"
|
||||
$READLINK "$1"
|
||||
}
|
||||
|
||||
abs_dirname() {
|
||||
|
|
|
@ -19,8 +19,14 @@ if [ -z "$RBENV_COMMAND" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
READLINK=$(type -p greadlink readlink | head -1)
|
||||
if [ -z "$READLINK" ]; then
|
||||
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
resolve_link() {
|
||||
$(type -p greadlink readlink | head -1) $1
|
||||
$READLINK "$1"
|
||||
}
|
||||
|
||||
realpath() {
|
||||
|
|
|
@ -25,8 +25,14 @@ if [ -z "$shell" ]; then
|
|||
shell="$(basename "$SHELL")"
|
||||
fi
|
||||
|
||||
READLINK=$(type -p greadlink readlink | head -1)
|
||||
if [ -z "$READLINK" ]; then
|
||||
echo "rbenv: cannot find readlink - are you missing GNU coreutils?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
resolve_link() {
|
||||
$(type -p greadlink readlink | head -1) $1
|
||||
$READLINK "$1"
|
||||
}
|
||||
|
||||
abs_dirname() {
|
||||
|
|
Loading…
Reference in a new issue