Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (27 sloc) 1.21 kb
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
#!/bin/sh

# rhino discards the path to the current script file, so we must add it back
SOURCE="$0"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
BASEPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# for whatever reason, Rhino requires module paths to be valid URIs
URLPATH="file://"$BASEPATH
URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'`
ENCODEDBASEPATH=`echo "$BASEPATH" | sed -e 's/ /%20/g'`

ARGS="$@"

if test "$1" = "--debug"
then
    echo "Running Debug"
    CMD="org.mozilla.javascript.tools.debugger.Main -debug"
    shift
else
    CMD="org.mozilla.javascript.tools.shell.Main"
fi

#Conditionally execute different command lines depending on whether we're running tests or not
if test "$1" = "-T"
then
    echo "Running Tests"
    java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"

else
    # normal mode should be quiet
    java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
fi
Something went wrong with that request. Please try again.