Files
LuaCsForBarotraumaEP/docs/scripts/install.ps1
peelz 5d11c28db6 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
2022-08-10 05:33:26 -04:00

42 lines
882 B
PowerShell

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
}