3 # launcher script for jsdoc
5 # Modified by Georges Khaznadar <georgesk@ofset.org>
7 # This program is released under the MIT License as follows:
9 # Copyright (c) 2008-2009 Atomic Inc <avi@jsorm.com>
10 # Copyright (c) 2011 Georges Khaznadar
12 #Permission is hereby granted, free of charge, to any person
13 #obtaining a copy of this software and associated documentation
14 #files (the "Software"), to deal in the Software without
15 #restriction, including without limitation the rights to use,
16 #copy, modify, merge, publish, distribute, sublicense, and/or sell
17 #copies of the Software, and to permit persons to whom the
18 #Software is furnished to do so, subject to the following
21 #The above copyright notice and this permission notice shall be
22 #included in all copies or substantial portions of the Software.
24 #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 #EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
26 #OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 #NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
28 #HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29 #WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 #FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31 #OTHER DEALINGS IN THE SOFTWARE.
34 check_mandatory_option
(){
36 if [ "$a" = -h ] ||
[ "$a" = --help ]; then ok
=1; fi
37 outdir
=$
(echo "$a" |
sed -n 's/-d=\(.\+\)/-d="\1"/p')
42 outdir
=$
(echo "$a" |
sed -n 's/--directory=\(.\+\)/--directory="\1"/p')
50 if ! [ "$ok" = 1 ]; then
51 echo "An argument like -d=<directory> or --directory=<directory> is mandatory!"
52 echo "Try 'jsdoc --help' or 'man jsdoc' for more information."
57 check_mandatory_option $@
59 if [ -n "$JSDOCDIR" ]; then
60 _DOCDIR
="-Djsdoc.dir=$JSDOCDIR"
65 if [ -n "$JSDOCTEMPLATEDIR" ]; then
66 _TDIR
="-Djsdoc.template.dir=$JSDOCTEMPLATEDIR"
68 _TDIR
="-Djsdoc.template.dir=/usr/share/jsdoc-toolkit/templates/jsdoc"
71 CMD
="java $_DOCDIR $_TDIR -cp /usr/share/java/jsrun.jar:/usr/share/java/js.jar JsRun /usr/share/jsdoc-toolkit/app/run.js $@"