feat: add lib table for exports

Anything assigned to the table will be exported; it's just a hacky way to provide support for Lua Language Server.
This commit is contained in:
Linden
2021-11-16 11:15:34 +11:00
parent 7c41ac5d6e
commit 52a3623e0e
2 changed files with 10 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ local LIBRARY = 'pe-lualib'
local SERVICE = IsDuplicityVersion() and 'server' or 'client'
local IMPORTS = {}
lib = exports[LIBRARY]
local function LoadFile(file)
local dir = ('imports/%s'):format(file)
local chunk = LoadResourceFile(LIBRARY, ('%s/%s.lua'):format(dir, SERVICE))

8
resource/main.lua Normal file
View File

@@ -0,0 +1,8 @@
-- Creates exports from values assigned to lib.
-- Hacky workaround for Lua Language Server support.
lib = setmetatable({}, {
__newindex = function(self, name, fn)
exports(name, fn)
end
})