generateDocs.sh: Simplify

* Make more like mediawiki-core's mwjsduckgen.
  - Use bash set -e to have the script abort early when any
    part of it fails (especially the jsduck command).
  - Since it will abort early, we don't need the 'test' for the
    symlink. If jsduck succeeded, it will have re-created the
    docs directory and thus not have the symlink yet.
  - Don't "cd" into anything from the script, simply use absolute
    paths instead. Both jsduck and ln support this.

Change-Id: I03c02d590e0f696c78da87ff638bb407e48a7cd7
This commit is contained in:
Timo Tijhof 2014-05-03 21:16:24 +02:00
parent 62324167ff
commit d6478ec548

View file

@ -1,13 +1,9 @@
#!/usr/bin/env bash
cd $(cd $(dirname $0)/..; pwd)
set -e
REPO_DIR=$(cd $(dirname $0)/..; pwd)
# Disable parallel processing which seems to be causing problems under Ruby 1.8
jsduck --config .docs/config.json --processes 0
ec=$?
jsduck --config $REPO_DIR/.docs/config.json --processes 0
test ! -L docs/lib && ln -s ../lib docs/lib || echo 'Symlink already exists'
cd - > /dev/null
# Exit with exit code of jsduck command
exit $ec
ln -s ../lib $REPO_DIR/docs/lib