diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-29 17:41:39 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-29 17:41:39 +0800 |
commit | 23d61d580988610f68c795c1fe495fc617344edc (patch) | |
tree | 253602f1a2c50a3eab63ff55a668c44e9d85c805 /server | |
parent | 5312636a09ba14e56f25d174ba380b0596f022a3 (diff) | |
download | lua-language-server-23d61d580988610f68c795c1fe495fc617344edc.zip |
修正路径计算bug
Diffstat (limited to 'server')
-rw-r--r-- | server/main.lua | 10 | ||||
-rw-r--r-- | server/publish.lua | 10 | ||||
-rw-r--r-- | server/test.lua | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/server/main.lua b/server/main.lua index ec1ccab0..da8a684e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,9 +1,9 @@ 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 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' ROOT = fs.path(rootPath) diff --git a/server/publish.lua b/server/publish.lua index ba0d0881..ca4423cb 100644 --- a/server/publish.lua +++ b/server/publish.lua @@ -1,9 +1,9 @@ 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 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' diff --git a/server/test.lua b/server/test.lua index a83990c7..4288f7dd 100644 --- a/server/test.lua +++ b/server/test.lua @@ -1,9 +1,9 @@ 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 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' |