diff options
Diffstat (limited to 'utils/bin/narwhal')
-rwxr-xr-x | utils/bin/narwhal | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/utils/bin/narwhal b/utils/bin/narwhal deleted file mode 100755 index 01fd4b1..0000000 --- a/utils/bin/narwhal +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# get the absolute path of the executable -SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH="$SELF_PATH/$(basename -- "$0")" - -# resolve symlinks -while [ -h "$SELF_PATH" ]; do - DIR=$(dirname -- "$SELF_PATH") - SYM=$(readlink -- "$SELF_PATH") - SELF_PATH=$(cd -- "$DIR" && cd -- $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM") -done - -# NARWHAL_HOME is the 2nd ancestor directory of this shell script -NARWHAL_HOME=$(dirname -- "$(dirname -- "$SELF_PATH")") - -# use Rhino as the default if none is specified in narwhal.conf -NARWHAL_DEFAULT_PLATFORM="rhino" - -# load narwhal.conf if it exists -if [ -f "$NARWHAL_HOME/narwhal.conf" ]; then - source "$NARWHAL_HOME"/narwhal.conf -fi - -# if NARWHAL_PLATFORM isn't yet set, set it to the default platform, and export it -if [ -z "$NARWHAL_PLATFORM" ]; then - NARWHAL_PLATFORM=$NARWHAL_DEFAULT_PLATFORM -fi -export NARWHAL_HOME - -# build the executable name for the platform -EXECUTABLE_NAME="narwhal-$NARWHAL_PLATFORM" - -# search for the platform home directory -# try narwhal.conf setting -if [ "$NARWHAL_PLATFORM_HOME" ]; then - export NARWHAL_PLATFORM_HOME -# try relative -elif [ -f "$NARWHAL_HOME/platforms/$NARWHAL_PLATFORM/bin/$EXECUTABLE_NAME" ]; then - export NARWHAL_PLATFORM_HOME="$NARWHAL_HOME/platforms/$NARWHAL_PLATFORM" -# try $PATH -elif which -s "$EXECUTABLE_NAME"; then - export NARWHAL_PLATFORM_HOME=$(dirname -- "$(dirname -- "$EXECUTABLE_NAME")") -else - echo "Can't find executable for $NARWHAL_PLATFORM" - exit 1 -fi - -exec "$NARWHAL_PLATFORM_HOME"/bin/"$EXECUTABLE_NAME" "$@" |