diff options
-rw-r--r-- | server/platform.lua | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/server/platform.lua b/server/platform.lua index b89a76bc..5b903ea1 100644 --- a/server/platform.lua +++ b/server/platform.lua @@ -1,18 +1,27 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) local rootPath = currentPath:gsub('[^/\\]-$', '') -if rootPath == '' then - rootPath = './' -end - -package.path = rootPath .. 'src/?.lua' - .. ';' .. rootPath .. 'src/?/init.lua' if package.loadlib(rootPath .. 'macOS/bin/bee.so', 'luaopen_bee_platform') then + if rootPath == '' then + rootPath = './' + end package.cpath = rootPath .. 'macOS/bin/?.so' + package.path = rootPath .. 'src/?.lua' + .. ';' .. rootPath .. 'src/?/init.lua' elseif package.loadlib(rootPath .. 'Linux/bin/bee.so', 'luaopen_bee_platform') then + if rootPath == '' then + rootPath = './' + end package.cpath = rootPath .. 'Linux/bin/?.so' + package.path = rootPath .. 'src/?.lua' + .. ';' .. rootPath .. 'src/?/init.lua' elseif package.loadlib(rootPath .. 'Windows/bin/bee.dll', 'luaopen_bee_platform') then - package.cpath = rootPath .. 'Windows/bin/?.dll' + if rootPath == '' then + rootPath = '.\\' + end + package.cpath = rootPath .. 'Windows\\bin\\?.dll' + package.path = rootPath .. 'src\\?.lua' + .. ';' .. rootPath .. 'src\\?\\init.lua' else error([[It doesn't seem to support your OS, please let me know at https://github.com/sumneko/lua-language-server/issues]]) end |