diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-18 17:44:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-18 17:44:31 +0800 |
commit | 0a2a30c57d44357abdfdc5ee47cb19e5eba8fb4c (patch) | |
tree | 90697a0efc902ab9835e96f7eba91ea0a0f1f3ec /server-beta/platform.lua | |
parent | 23780ea2f3c6c69c7e7983541981995c0edd9017 (diff) | |
download | lua-language-server-0a2a30c57d44357abdfdc5ee47cb19e5eba8fb4c.zip |
beta
Diffstat (limited to 'server-beta/platform.lua')
-rw-r--r-- | server-beta/platform.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server-beta/platform.lua b/server-beta/platform.lua new file mode 100644 index 00000000..5384ad3d --- /dev/null +++ b/server-beta/platform.lua @@ -0,0 +1,26 @@ +local currentPath = debug.getinfo(1, 'S').source:sub(2) +local rootPath = currentPath:gsub('[^/\\]-$', '') +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 + package.cpath = rootPath .. 'macOS/bin/?.so' + package.path = rootPath .. 'src/?.lua' + .. ';' .. rootPath .. 'src/?/init.lua' +elseif package.loadlib(rootPath .. 'Linux/bin/bee.so', 'luaopen_bee_platform') then + if rootPath == '' then + rootPath = './' + end + package.cpath = rootPath .. 'Linux/bin/?.so' + 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 |