Skip to content
Snippets Groups Projects
Commit b237d035 authored by 最萌小汐's avatar 最萌小汐
Browse files

#110 更新cpath计算方式

parent 27a141bb
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,21 @@ local function findExePath()
end
local exePath = findExePath()
local exeDir = exePath:gsub('[^/\\]-$', '')
local dll = exePath:sub(-4) == '.exe' and '.dll' or '.so'
package.cpath = exeDir .. '?' .. dll
if not package.loadlib(exeDir..'bee'..dll, 'luaopen_bee_platform') 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]])
local exeDir = exePath:match('(.+)[/\\][%w_.-]+$')
local dll = package.cpath:match '[/\\]%?%.([a-z]+)'
package.cpath = ('%s/?.%s'):format(exeDir, dll)
if not package.loadlib(exeDir..'/bee.'..dll, 'luaopen_bee_platform') 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
exePath: %s
exeDir: %s
dll: %s
cpath: %s
]]):format(
exePath,
exeDir,
dll,
package.cpath
))
end
local fs = require 'bee.filesystem'
......
local wait = ...
local fs = require 'bee.filesystem'
local extensionPath = fs.path(os.getenv 'USERPROFILE') / '.vscode' / 'extensions'
local extensionPath = fs.path(os.getenv 'USERPROFILE' or '') / '.vscode' / 'extensions'
log.debug('Search extensions at:', extensionPath:string())
if not fs.is_directory(extensionPath) then
log.debug('Extension path is not a directory.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment