1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00
phorge-arcanist/bin/arc
Sébastien Santoro 088091ca40 Make bin/arc less linux-centered, more UNIX-agnostic
Summary: Using /usr/bin/env in #! to allow the arc script to run as is in every UNIX OSes, like FreeBSD where bash is installed in /usr/local/bin/bash.

Test Plan: Tested on Solaris, Ubuntu, kFreeBSD/Debian and FreeBSD.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T1440

Differential Revision: https://secure.phabricator.com/D2913
2012-07-03 06:34:49 -07:00

21 lines
582 B
Bash
Executable file

#!/usr/bin/env bash
# NOTE: This file is a wrapper script instead of a symlink so it will work in
# the Git Bash environment in Windows.
# Do bash magic to resolve the real location of this script through aliases,
# symlinks, etc.
SOURCE="${BASH_SOURCE[0]}";
while [ -h "$SOURCE" ]; do
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 "$@"