jsdoc/jsdoc
Jeff Williams d29632364b remove URI-conversion and dirname-specification cruft
includes new Rhino .jar to allow module directories to be specified as paths:
https://github.com/jsdoc3/rhino/tree/5dd82a4c
2013-12-24 21:08:28 -08:00

34 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
SOURCE="$0"
while [ -h "$SOURCE" ] ; do
NEXTSOURCE="$(readlink "$SOURCE")"
echo $NEXTSOURCE | grep -q -e "^/"
if [ $? = 0 ]; then
SOURCE="$NEXTSOURCE"
else
SOURCE="$(dirname $SOURCE)/$NEXTSOURCE"
fi
done
# Get a Windows path under MinGW or Cygwin
BASEPATH="$( cd -P "$( dirname "$SOURCE" )" && (pwd -W 2>/dev/null || cygpath -w $(pwd) 2>/dev/null || pwd))"
if [ "${BASEPATH%${BASEPATH#?}}" != "/" ] ; then
BASEPATH="$( echo "$BASEPATH" | sed -e 's@\\@/@g' )"
fi
if test "$1" = "--debug"
then
CMD="org.mozilla.javascript.tools.debugger.Main -debug -opt -1"
else
CMD="org.mozilla.javascript.tools.shell.Main"
fi
if test "$1" = "-T"
then
cd -P "$(dirname "$SOURCE")"
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -opt -1 -modules "${BASEPATH}/lib" -modules "${BASEPATH}/node_modules" -modules "${BASEPATH}/rhino" -modules "${BASEPATH}" "${BASEPATH}/jsdoc.js" "$@"
else
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -modules "${BASEPATH}/lib" -modules "${BASEPATH}/node_modules" -modules "${BASEPATH}/rhino" -modules "${BASEPATH}" "${BASEPATH}/jsdoc.js" "$@"
fi