mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-01 06:35:50 +01:00
Merge pull request #9 from mudge/patch-1
Solaris doesn't come with readlink so use greadlink if available instead.
This commit is contained in:
commit
795e5aee0e
1 changed files with 5 additions and 1 deletions
6
bin/ruby-build
Executable file → Normal file
6
bin/ruby-build
Executable file → Normal file
|
@ -3,6 +3,10 @@
|
|||
set -E
|
||||
exec 3<&2 # preserve original stderr at fd 3
|
||||
|
||||
resolve_link() {
|
||||
$(type -p greadlink readlink | head -1) $1
|
||||
}
|
||||
|
||||
abs_dirname() {
|
||||
local cwd="$(pwd)"
|
||||
local path="$1"
|
||||
|
@ -10,7 +14,7 @@ abs_dirname() {
|
|||
while [ -n "$path" ]; do
|
||||
cd "${path%/*}"
|
||||
local name="${path##*/}"
|
||||
path="$(readlink "$name" || true)"
|
||||
path="$(resolve_link "$name" || true)"
|
||||
done
|
||||
|
||||
pwd
|
||||
|
|
Loading…
Reference in a new issue