mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 08:12:40 +01:00
Minor, correct arc handling of relative symlinking (from @makinde).
This commit is contained in:
parent
0d76ac6968
commit
2a66d6bde9
1 changed files with 8 additions and 2 deletions
10
bin/arc
10
bin/arc
|
@ -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 "$@"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue