feat(lua): add utility functions to detect Lua, OS, Python environment, TypeScript environment, Git root, and safe function invocation.

This commit is contained in:
David Ibia
2025-07-21 16:53:44 +01:00
commit 107d3c5db2
7 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
function SafeInvoke(func)
-- safely invoke a functions
-- if the function returns an error, return an empty string
-- otherwise return the result of the function
local ok, result = pcall(func)
if ok then
return result
else
return ""
end
end
return SafeInvoke