From e942fb2edfc386c1d5bfbdc644ca370d1899e06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 4 Sep 2019 14:32:09 +0800 Subject: =?UTF-8?q?=E4=BC=98=E5=85=88=E5=B0=9D=E8=AF=95=20Windows=20?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.lua | 2 +- 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 -- cgit v1.2.3