From 1dbf4ed28a095013837ecbbc0c7c1ba0e7ebacfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 25 Mar 2021 20:08:26 +0800 Subject: #462 supports debugger attach --- platform.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform.lua') diff --git a/platform.lua b/platform.lua index eb318a84..e984a272 100644 --- a/platform.lua +++ b/platform.lua @@ -32,7 +32,7 @@ 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 +if dll == 'dll' then rootPath = rootPath:gsub('/', '\\') package.path = rootPath .. script .. '\\?.lua' .. ';' .. rootPath .. script .. '\\?\\init.lua' @@ -50,7 +50,8 @@ package.searchers[2] = function (name) local f = io.open(filename) local buf = f:read '*a' f:close() - local init, err = load(buf, '@' .. name) + local relative = filename:sub(#rootPath + 1) + local init, err = load(buf, '@' .. relative) if not init then return err end -- cgit v1.2.3