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:
Sam Stephenson 2011-08-16 14:45:06 -07:00
commit 795e5aee0e

6
bin/ruby-build Executable file → Normal file
View 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