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:
peelz
2022-08-03 21:34:41 -04:00
parent 9a621237f0
commit 5d11c28db6
15 changed files with 178 additions and 46 deletions
+41
View File
@@ -0,0 +1,41 @@
try {
cd $PSScriptRoot/..
$lua_binary = $env:LUA_BINARY
if ($lua_binary -eq $null) {
$lua_binary = "lua"
}
if ((Get-Command "$lua_binary" -ErrorAction SilentlyContinue) -eq $null) {
if ($env:LUA_BINARY -eq $null) {
echo "lua binary not found; please set `$LUA_BINARY manually."
} else {
echo "lua binary not found: $lua_binary"
}
exit 1
}
if ((Get-Command "luarocks" -ErrorAction SilentlyContinue) -eq $null) {
echo "luarocks not found"
exit 1
}
$lua_version = (Invoke-Expression -Command "& $lua_binary -v 2>&1") -Replace '^Lua (\d+)\.(\d+).*$','$1.$2'
echo "Detected lua version $lua_version"
$luarocks_args=@(
"--tree",
"$(Get-Location)/lua_modules",
"--lua-version",
"$lua_version"
)
try {
cd ./libs/ldoc
luarocks @luarocks_args make
} finally {
popd
}
} finally {
popd
}