diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-29 17:32:21 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-29 17:32:21 +0800 |
commit | 5312636a09ba14e56f25d174ba380b0596f022a3 (patch) | |
tree | d30df363362262e62703247ee27dd10897e51e03 | |
parent | 3a30b6af0402dcff796c9d843fd30381de346022 (diff) | |
download | lua-language-server-5312636a09ba14e56f25d174ba380b0596f022a3.zip |
更新测试与发布
-rw-r--r-- | server/publish.lua | 12 | ||||
-rw-r--r-- | server/test.lua | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/server/publish.lua b/server/publish.lua index a271e480..ba0d0881 100644 --- a/server/publish.lua +++ b/server/publish.lua @@ -1,10 +1,14 @@ +local currentPath = debug.getinfo(1, 'S').source:sub(2) +local rootPath = currentPath:gsub('[/\\][^/\\]-$', '') +package.cpath = rootPath .. '/bin/?.so' + .. ';' .. rootPath .. '/bin/?.dll' +package.path = rootPath .. '/src/?.lua' + .. ';' .. rootPath .. '/src/?/init.lua' + local fs = require 'bee.filesystem' local subprocess = require 'bee.subprocess' - -ROOT = fs.current_path() +ROOT = fs.path(rootPath) EXTENSION = ROOT:parent_path() -package.path = (ROOT / 'src' / '?.lua'):string() - .. ';' .. (ROOT / 'src' / '?' / 'init.lua'):string() require 'utility' local json = require 'json' diff --git a/server/test.lua b/server/test.lua index d39edda4..a83990c7 100644 --- a/server/test.lua +++ b/server/test.lua @@ -1,9 +1,13 @@ +local currentPath = debug.getinfo(1, 'S').source:sub(2) +local rootPath = currentPath:gsub('[/\\][^/\\]-$', '') +package.cpath = rootPath .. '/bin/?.so' + .. ';' .. rootPath .. '/bin/?.dll' +package.path = rootPath .. '/src/?.lua' + .. ';' .. rootPath .. '/src/?/init.lua' + local fs = require 'bee.filesystem' local subprocess = require 'bee.subprocess' - -ROOT = fs.current_path() -package.path = (ROOT / 'src' / '?.lua'):string() - .. ';' .. (ROOT / 'src' / '?' / 'init.lua'):string() +ROOT = fs.path(rootPath) local function runTest(root) local is_macos = package.cpath:sub(-3) == '.so' |