diff options
-rw-r--r-- | server/main.lua | 2 | ||||
-rw-r--r-- | server/platform.lua | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/server/main.lua b/server/main.lua index 1f4bfac7..a01db8cb 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,6 +1,6 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) local rootPath = currentPath:gsub('[^/\\]-$', '') -dofile('./' .. rootPath .. 'platform.lua') +dofile(rootPath .. 'platform.lua') local fs = require 'bee.filesystem' ROOT = fs.absolute(fs.path(rootPath)):parent_path():parent_path() LANG = LANG or 'en-US' diff --git a/server/platform.lua b/server/platform.lua index 5b903ea1..5384ad3d 100644 --- a/server/platform.lua +++ b/server/platform.lua @@ -1,7 +1,13 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) local rootPath = currentPath:gsub('[^/\\]-$', '') - -if package.loadlib(rootPath .. 'macOS/bin/bee.so', 'luaopen_bee_platform') then +if package.loadlib(rootPath .. 'Windows/bin/bee.dll', 'luaopen_bee_platform') then + if rootPath == '' then + rootPath = '.\\' + end + package.cpath = rootPath .. 'Windows\\bin\\?.dll' + package.path = rootPath .. 'src\\?.lua' + .. ';' .. rootPath .. 'src\\?\\init.lua' +elseif package.loadlib(rootPath .. 'macOS/bin/bee.so', 'luaopen_bee_platform') then if rootPath == '' then rootPath = './' end @@ -15,13 +21,6 @@ elseif package.loadlib(rootPath .. 'Linux/bin/bee.so', 'luaopen_bee_platform') t 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 - 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 |