From d6478ec548d6b2c6d2b8b846f8d2751fc8d2d547 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 3 May 2014 21:16:24 +0200 Subject: [PATCH] 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 --- bin/generateDocs.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/generateDocs.sh b/bin/generateDocs.sh index f2ebf6e3ab..5cf94222dd 100755 --- a/bin/generateDocs.sh +++ b/bin/generateDocs.sh @@ -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