mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Merge pull request #182 from BobKerns/mingw
Make jsdoc script work with MinGW and Cygwin
This commit is contained in:
commit
da485dff2c
13
jsdoc
13
jsdoc
@ -3,10 +3,18 @@
|
||||
# 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 )"
|
||||
# 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:0:1}" != "/" ] ; then
|
||||
BASEPATH="${BASEPATH//\\//}"
|
||||
# We need a extra slash for URLs
|
||||
UBASEPATH="/$BASEPATH"
|
||||
else
|
||||
UBASEPATH="$BASEPATH"
|
||||
fi
|
||||
|
||||
# for whatever reason, Rhino requires module paths to be valid URIs
|
||||
URLPATH="file://"$BASEPATH
|
||||
URLPATH="file://$UBASEPATH"
|
||||
URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'`
|
||||
ENCODEDBASEPATH=`echo "$BASEPATH" | sed -e 's/ /%20/g'`
|
||||
|
||||
@ -27,6 +35,7 @@ fi
|
||||
if test "$1" = "-T"
|
||||
then
|
||||
echo "Running Tests"
|
||||
cd -P "$(dirname "$SOURCE")"
|
||||
java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/nodejs_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
|
||||
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user