forked from awpeters/jspdftk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrhino
executable file
·42 lines (35 loc) · 1009 Bytes
/
rhino
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
35
36
37
38
39
40
41
42
#!/bin/bash
JAVACMD=java
export IFS=$'\n'
if [ -z "$PRG_HOME" -o ! -d "$PRG_HOME" ] ; then
## resolve links - $0 may be a link to program's home
PRG="$0"
progname=`basename "$0"`
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
PRG_HOME=`dirname "$PRG"`
# make it fully qualified
PRG_HOME=`cd "$PRG_HOME" && pwd`
fi
DIRLIBS=${PRG_HOME}/lib/*.jar
for i in ${DIRLIBS}
do
# if the directory is empty, then it will return the input string
# this is stupid, so case for it
if [ "$i" != "${DIRLIBS}" ] ; then
if [ -z "$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH=$i
else
LOCALCLASSPATH="$i":$LOCALCLASSPATH
fi
fi
done
exec "$JAVACMD" $LOGCHOICE $LOGLEVEL -classpath "$LOCALCLASSPATH" -Xmx2000m org.mozilla.javascript.tools.shell.Main -opt -1 -debug $*