1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Minor, correct arc handling of relative symlinking (from @makinde).

This commit is contained in:
epriestley 2012-03-30 14:56:19 -07:00
parent 0d76ac6968
commit 2a66d6bde9

10
bin/arc
View file

@ -7,9 +7,15 @@
# symlinks, etc. # symlinks, etc.
SOURCE="${BASH_SOURCE[0]}"; SOURCE="${BASH_SOURCE[0]}";
while [ -h "$SOURCE" ]; do 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; done;
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
exec $DIR/../scripts/arcanist.php "$@" exec $DIR/../scripts/arcanist.php "$@"