summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-29 17:41:39 +0800
committersumneko <sumneko@hotmail.com>2019-05-29 17:41:39 +0800
commit23d61d580988610f68c795c1fe495fc617344edc (patch)
tree253602f1a2c50a3eab63ff55a668c44e9d85c805 /server
parent5312636a09ba14e56f25d174ba380b0596f022a3 (diff)
downloadlua-language-server-23d61d580988610f68c795c1fe495fc617344edc.zip
修正路径计算bug
Diffstat (limited to 'server')
-rw-r--r--server/main.lua10
-rw-r--r--server/publish.lua10
-rw-r--r--server/test.lua10
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'