forked from cappuccino/cappuccino
-
Notifications
You must be signed in to change notification settings - Fork 5
/
cplutil
34 lines (27 loc) · 917 Bytes
/
cplutil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar"
# convert paths for Cygwin
if [[ `uname` == CYGWIN* ]]; then
CLASSPATH=`cygpath -wp "$CLASSPATH"`
fi
java -classpath $CLASSPATH cplutil $@