Clean up lua docs scripts
- ldoc is now a git submodule
- ldoc can be installed using scripts/install.{sh,ps1}
- lua docs can be build using scripts/build.{sh,ps1}
- all lua docs-related files now reside inside of the docs folder
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
cd "$DIR/.."
|
||||
|
||||
lua_binary="${LUA_BINARY:-lua}"
|
||||
|
||||
if ! command -v "$lua_binary" &> /dev/null; then
|
||||
if [[ -z "${LUA_BINARY+x}" ]]; then
|
||||
echo "lua binary not found; please set \$LUA_BINARY manually."
|
||||
else
|
||||
echo "lua binary not found: $lua_binary"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v "$lua_binary" &> /dev/null; then
|
||||
echo "luarocks not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lua_version="$("$lua_binary" -v | grep -Po '^Lua \K(\d+)\.(\d+)')"
|
||||
echo "Detected lua version $lua_version"
|
||||
|
||||
# Install dependencies (npm style)
|
||||
# NOTE: you need to have lua header files installed.
|
||||
# On debian-based distros: apt install libluaX.X-dev
|
||||
|
||||
luarocks_args=(
|
||||
"--tree"
|
||||
"$PWD/lua_modules"
|
||||
"--lua-version"
|
||||
"$lua_version"
|
||||
)
|
||||
|
||||
(
|
||||
cd libs/ldoc
|
||||
luarocks ${luarocks_args[@]} make
|
||||
)
|
||||
Reference in New Issue
Block a user