summaryrefslogtreecommitdiffhomepage
path: root/build/makedocs.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-28 22:27:46 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-28 22:28:04 +0100
commitc669c01cea36ce09b64a53dc0e597d27411e9c88 (patch)
treef17a7dc0ba0646743fb760204b9fa925e9efa451 /build/makedocs.sh
parente6e74b712fe6fd87cb19e89203e4ef45d7459458 (diff)
build: add modified luadoc for use with LuCI sources
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'build/makedocs.sh')
-rwxr-xr-xbuild/makedocs.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/build/makedocs.sh b/build/makedocs.sh
index 2f7f57345..a9fc760e7 100755
--- a/build/makedocs.sh
+++ b/build/makedocs.sh
@@ -1,2 +1,14 @@
-luadoc -d $2 --no-files $(for f in $(find $1 -name '*.lua' -type f); do if grep -q -- "@return" $f; then echo $f; fi; done)
-echo API-Documentation was created in $2.
+#!/bin/bash
+
+topdir=$(pwd)
+
+[ -f "$topdir/build/makedocs.sh" -a -n "$1" ] || {
+ echo "Please execute as ./build/makedocs.sh [output directory]" >&2
+ exit 1
+}
+
+(
+ cd "$topdir/build/luadoc/"
+ find "$topdir/libs/" "$topdir/modules/" -type f -name '*.lua' -or -name '*.luadoc' | \
+ xargs grep -l '@return' | xargs ./doc.lua --no-files -d "$1"
+)