diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-10-15 15:29:52 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-10-24 16:41:08 +0300 |
commit | 5d888984a0db8dfc04be8b398e75f04f6894fa32 (patch) | |
tree | dc6cee2c1da08be68015717ea4eff03916134be6 /build/buildjsdocs.sh | |
parent | 37782b1084275d54474700e4ae7863b18e23dc04 (diff) |
Fix jsdocs build on server repo
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'build/buildjsdocs.sh')
-rwxr-xr-x | build/buildjsdocs.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/build/buildjsdocs.sh b/build/buildjsdocs.sh new file mode 100755 index 00000000000..dd2af210277 --- /dev/null +++ b/build/buildjsdocs.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# +# ownCloud +# +# Run JS tests +# +# @author Vincent Petry +# @copyright 2014 Vincent Petry <pvince81@owncloud.com> +# +NPM="$(which npm 2>/dev/null)" +OUTPUT_DIR="jsdocs" + +JS_FILES="../core/js/*.js ../core/js/**/*.js ../apps/*/js/*.js" + +if test -z "$NPM" +then + echo 'Node JS >= 0.8 is required to build the documentation' >&2 + exit 1 +fi + +# update/install test packages +$NPM install --prefix . --link jsdoc || exit 3 + +JSDOC_BIN="$(which jsdoc 2>/dev/null)" + +# If not installed globally, try local version +if test -z "$JSDOC_BIN" +then + JSDOC_BIN="./node_modules/jsdoc/jsdoc.js" +fi + +if test -z "$JSDOC_BIN" +then + echo 'jsdoc executable not found' >&2 + exit 2 +fi + +mkdir -p "$OUTPUT_DIR" + +NODE_PATH="./node_modules" $JSDOC_BIN -d "$OUTPUT_DIR" $JS_FILES + |