diff options
author | actboy168 <actboy168@gmail.com> | 2021-10-02 12:40:35 +0800 |
---|---|---|
committer | actboy168 <actboy168@gmail.com> | 2021-10-02 12:40:35 +0800 |
commit | 754b69b88f8f1053e6452261e30cae9e10ca122c (patch) | |
tree | e13c56ed89e2d998b876a43a7ba9556a87f25d5c /platform.lua | |
parent | 70335a4e87c2d8b82a30926c2560efde94d2587b (diff) | |
download | lua-language-server-754b69b88f8f1053e6452261e30cae9e10ca122c.zip |
更新编译脚本
Diffstat (limited to 'platform.lua')
-rw-r--r-- | platform.lua | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/platform.lua b/platform.lua deleted file mode 100644 index 85a948fa..00000000 --- a/platform.lua +++ /dev/null @@ -1,63 +0,0 @@ -local script = ... - -local function findExePath() - local n = 0 - while arg[n-1] do - n = n - 1 - end - return arg[n] -end - -local exePath = findExePath() -local exeDir = exePath:match('(.+)[/\\][%w_.-]+$') -local dll = package.cpath:match '[/\\]%?%.([a-z]+)' -package.cpath = ('%s/?.%s;%s'):format(exeDir, dll, package.cpath) -local bee = package.searchpath('bee', package.cpath) -if not bee then - error('Can not find bee.dll? cpath = ' .. tostring(package.cpath)) -end -local ok, err = package.loadlib(bee, 'luaopen_bee_platform') -if not ok then - error(([[It doesn't seem to support your OS, please build it in your OS, see https://github.com/sumneko/vscode-lua/wiki/Build -errorMsg: %s -exePath: %s -exeDir: %s -dll: %s -cpath: %s -]]):format( - err, - exePath, - exeDir, - dll, - package.cpath -)) -end - -local currentPath = debug.getinfo(1, 'S').source:sub(2) -local fs = require 'bee.filesystem' -local rootPath = fs.path(currentPath):remove_filename():string() -if dll == 'dll' then - rootPath = rootPath:gsub('/', '\\') - package.path = rootPath .. script .. '\\?.lua' - .. ';' .. rootPath .. script .. '\\?\\init.lua' -else - rootPath = rootPath:gsub('\\', '/') - package.path = rootPath .. script .. '/?.lua' - .. ';' .. rootPath .. script .. '/?/init.lua' -end - -package.searchers[2] = function (name) - local filename, err = package.searchpath(name, package.path) - if not filename then - return err - end - local f = io.open(filename) - local buf = f:read '*a' - f:close() - local relative = filename:sub(#rootPath + 1) - local init, err = load(buf, '@' .. relative) - if not init then - return err - end - return init, filename -end |