mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-26 21:47:04 +00:00
37 lines
913 B
Bash
37 lines
913 B
Bash
#!/bin/sh
|
|
|
|
# if OBJJ_HOME isn't set, try to determine it
|
|
if [ -z $OBJJ_HOME ]; then
|
|
# get path of the executable
|
|
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
|
|
|
|
# resolve symlinks
|
|
if [ -h $SELF_PATH ]; then
|
|
SELF_PATH=`readlink $SELF_PATH`
|
|
fi
|
|
|
|
# get second ancestor directory
|
|
SELF_DIR=`dirname $SELF_PATH`
|
|
export OBJJ_HOME=`dirname $SELF_DIR`
|
|
|
|
# check to ensure it exists, print message
|
|
if [ -d $OBJJ_HOME ]; then
|
|
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
|
|
else
|
|
echo "OBJJ_HOME not set, default at $OBJJ_HOME doesn't exist, exiting" 1>&2
|
|
exit 2
|
|
fi
|
|
fi
|
|
|
|
OBJJ_LIB="$OBJJ_HOME/lib"
|
|
|
|
PRESS="$OBJJ_LIB/press.j"
|
|
|
|
# convert paths for Cygwin
|
|
if [[ `uname` == CYGWIN* ]]; then
|
|
OBJJ_HOME=`cygpath -w "$OBJJ_HOME"`
|
|
PRESS=`cygpath -w "$PRESS"`
|
|
fi
|
|
|
|
objj $PRESS $@
|