Commit 795e5aee authored by Sam Stephenson's avatar Sam Stephenson
Browse files

Merge pull request #9 from mudge/patch-1

Solaris doesn't come with readlink so use greadlink if available instead.
parents b1d097a8 c6a552e7
Loading
Loading
Loading
Loading

bin/ruby-build

100755 → 100644
+5 −1
Original line number Diff line number Diff line
@@ -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