From: epriestley Date: Fri, 30 Mar 2012 21:56:19 +0000 (-0700) Subject: Minor, correct arc handling of relative symlinking (from @makinde). X-Git-Tag: conduit-4~67 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2a66d6bde94ffc4472ec5188f812903dc8780de6;p=arcanist.git Minor, correct arc handling of relative symlinking (from @makinde). --- diff --git a/bin/arc b/bin/arc index 4436fa89..d90715e7 100755 --- a/bin/arc +++ b/bin/arc @@ -7,9 +7,15 @@ # symlinks, etc. SOURCE="${BASH_SOURCE[0]}"; while [ -h "$SOURCE" ]; do - SOURCE="$(readlink "$SOURCE")"; + LINK="$(readlink "$SOURCE")"; + if [ "${LINK:0:1}" == "/" ]; then + # absolute symlink + SOURCE="$LINK" + else + # relative symlink + SOURCE="$(cd -P "$(dirname "$SOURCE")" && pwd)/$LINK" + fi done; DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" exec $DIR/../scripts/arcanist.php "$@" -